/*
  Shared style kit for tools.instructionaldesigner.ie
  Every tool links this file so they all look and behave the same, and match
  the WordPress site (Avada): Poppins headings, Inter body text, navy brand colours.

  Load the fonts in each page's <head>, before this file (they are hosted here, never from Google):
  <link rel="preload" href="../shared/fonts/inter-var-latin.woff2" as="font" type="font/woff2" crossorigin>
  <link rel="stylesheet" href="../shared/fonts.css">

  Page skeleton: .site-header, .page-hero (eyebrow, h1, intro), main.wrap, .site-footer.
  Load ../shared/site.js (defer) for the mobile menu and footer year.
*/

/* ---------- Tokens ---------- */
:root {
  /* Brand colours, taken from the WordPress theme */
  --brand: #06507F;        /* primary navy */
  --brand-mid: #1A80B6;    /* mid blue */
  --brand-bright: #0A72EE; /* bright blue (site buttons) */
  --brand-dark: #212934;   /* near-black navy */

  --bg: #FFFFFF;          /* page background, white like the WordPress content area */
  --field-bg: #FFFFFF;
  --subtle: #F6F6F6;      /* light grey for quiet areas, as on the WordPress site */
  --panel: #FFFFFF;
  --ink: #212934;
  --text: #333333;
  --muted: #5F6670;
  --line: #DADDE1;
  --accent: var(--brand);
  --accent-hover: #0A3F63;
  --accent-ink: #FFFFFF;
  --btn-bg: var(--brand);
  --btn-hover: #0A3F63;
  --btn-ink: #FFFFFF;
  --heading-accent: var(--brand);
  --brand-tint: #E8F0F6;
  --link: var(--brand);
  --warn: #8A4B00;
  --warn-bg: #FFF3E0;
  --ok: #1B6E3A;
  --ok-bg: #E6F4EA;

  --font-heading: "Poppins", Arial, Helvetica, sans-serif;
  --font-body: "Inter", "Segoe UI", system-ui, -apple-system, Arial, sans-serif;
  --font-mono: Menlo, Consolas, Monaco, monospace;

  --radius: 10px;
  --radius-sm: 6px;
  --radius-pill: 999px;
  --shadow: 0 1px 2px rgba(33, 41, 52, .06), 0 4px 16px rgba(33, 41, 52, .06);
  --wrap: 1180px;

  color-scheme: light;
}
/* Light only, to match the WordPress site, which has no dark mode. */

/* ---------- Base ---------- */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0; min-height: 100vh; display: flex; flex-direction: column;
  background: var(--bg); color: var(--text);
  font-family: var(--font-body); font-size: 1rem; line-height: 1.55;
}
h1, h2, h3 { font-family: var(--font-heading); color: var(--ink); font-weight: 700; line-height: 1.2; }
a { color: var(--link); }
a:hover { color: var(--accent-hover); }
:focus-visible { outline: 3px solid var(--brand-bright); outline-offset: 2px; }
[hidden] { display: none !important; }
.visually-hidden {
  position: absolute !important; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0;
}
.skip-link { position: absolute; left: 1rem; top: -3rem; z-index: 10; background: var(--panel); color: var(--ink); padding: .5rem .9rem; border-radius: var(--radius-sm); }
.skip-link:focus { top: 1rem; }

.wrap { width: 100%; max-width: var(--wrap); margin: 0 auto; padding: 0 1rem; }
@media (min-width: 640px) { .wrap { padding: 0 1.5rem; } }
main.wrap { flex: 1; padding-top: 2rem; padding-bottom: 3rem; }

/* ---------- Site header ----------
   Mirrors the WordPress (Avada) header: white, large logo,
   Poppins menu with a 3 px underline on the current section, soft shadow below,
   and a menu button on narrower screens (toggled by shared/site.js). */
.site-header { position: relative; z-index: 5; background: #FFFFFF; box-shadow: 0 8px 28px rgba(0, 0, 0, .08); }
.site-header .wrap { display: flex; align-items: center; justify-content: space-between; gap: 1rem; padding-top: 1.1rem; padding-bottom: 1.1rem; }
.brand { display: inline-flex; flex-shrink: 0; }
.brand img { display: block; height: 120px; width: auto; }
.site-nav ul { list-style: none; margin: 0; padding: 0; display: flex; align-items: center; gap: 48px; }
.site-nav a {
  display: inline-block; font-family: var(--font-heading); font-size: 18px; font-weight: 400; line-height: 1.4;
  color: #333333; text-decoration: none; padding: 6px 0 4px; border-bottom: 3px solid transparent;
}
.site-nav a:hover, .site-nav a.current { color: #555B6E; border-bottom-color: #555B6E; }
.site-nav a:focus-visible { outline-color: #0A72EE; }
.site-header .nav-toggle {
  display: none; background: transparent; border: 0; border-radius: var(--radius-sm); padding: 12px 8px; color: #333333;
}
.site-header .nav-toggle:hover:not(:disabled) { background: var(--subtle); color: #333333; }
.nav-toggle .bars, .nav-toggle .bars::before, .nav-toggle .bars::after {
  display: block; width: 30px; height: 2px; background: currentColor; border-radius: 1px; transition: transform .2s, opacity .2s;
}
.nav-toggle .bars { position: relative; }
.nav-toggle .bars::before, .nav-toggle .bars::after { content: ""; position: absolute; left: 0; }
.nav-toggle .bars::before { top: -9px; }
.nav-toggle .bars::after { top: 9px; }
.site-nav.open .nav-toggle .bars { background: transparent; }
.site-nav.open .nav-toggle .bars::before { transform: translateY(9px) rotate(45deg); }
.site-nav.open .nav-toggle .bars::after { transform: translateY(-9px) rotate(-45deg); }

@media (max-width: 1000px) {
  .brand img { height: 96px; }
  .site-header .nav-toggle { display: inline-flex; }
  .site-nav ul {
    display: none; position: absolute; left: 0; right: 0; top: 100%;
    flex-direction: column; align-items: stretch; gap: 0;
    background: #FFFFFF; padding: 0 1rem .75rem; box-shadow: 0 12px 24px rgba(0, 0, 0, .1);
  }
  .site-nav.open ul { display: flex; }
  .site-nav li a { display: block; padding: .8rem .25rem; border-bottom: 1px solid #E2E2E2; }
  .site-nav li a:hover, .site-nav li a.current { border-bottom-color: #E2E2E2; box-shadow: inset 3px 0 0 #555B6E; padding-left: .75rem; }
}
@media (max-width: 400px) { .brand img { height: 80px; } }

/* Wide screens: match the Avada header measurements exactly.
   Logo 416 x 150 with a 34 px top margin (header 184 px tall), 1200 px content row,
   menu links fill a 169 px band with the 3 px bar along its bottom edge. */
@media (min-width: 1001px) {
  .site-header .wrap { max-width: calc(1200px + 3rem); align-items: flex-start; padding-top: 0; padding-bottom: 0; }
  .brand { margin-top: 34px; }
  .brand img { height: 150px; }
  .site-nav { margin-top: 65px; } /* puts the menu text and its underline where Avada draws them */
}

/* ---------- Page hero (matches the WordPress page title bar) ---------- */
.page-hero { position: relative; overflow: hidden; background: var(--brand); color: #FFFFFF; }
.page-hero::after {
  /* echo of the circle in the logo */
  content: ""; position: absolute; right: -90px; top: -120px; width: 340px; height: 340px; border-radius: 50%;
  background: rgba(255, 255, 255, .06); pointer-events: none;
}
.page-hero .wrap { position: relative; z-index: 1; padding-top: 2.25rem; padding-bottom: 2.25rem; }
.page-hero .inner { max-width: none; }
.page-hero p + p { margin-top: .75rem; }
.page-hero .eyebrow {
  display: inline-block; font-family: var(--font-heading); font-weight: 600; font-size: .85rem;
  color: #9FD0F2; margin: 0 0 .35rem; letter-spacing: .01em;
}
.page-hero h1 { color: #FFFFFF; font-size: clamp(1.75rem, 4vw, 2.4rem); margin: 0 0 .5rem; letter-spacing: -0.01em; }
.page-hero p { margin: 0; color: #D6E6F2; }
.page-hero .private { font-size: .92rem; }
/* Link back to the tools homepage, shown above the eyebrow on every tool page */
.page-hero .back-link {
  display: flex; width: fit-content; align-items: center; gap: .35rem; margin: 0 0 1rem; font-size: .9rem; font-weight: 600;
  color: #FFFFFF; text-decoration: none; border-bottom: 1px solid rgba(255, 255, 255, .4); padding-bottom: .1rem;
}
.page-hero .back-link:hover { border-bottom-color: #FFFFFF; }
.page-hero .back-link:focus-visible { outline: 3px solid #FFFFFF; outline-offset: 3px; border-radius: 2px; }
.page-hero .back-link svg { width: 14px; height: 14px; }
@media (max-width: 520px) { .page-hero::after { width: 200px; height: 200px; right: -70px; top: -80px; } }

/* ---------- Panels ---------- */
.panel { background: var(--panel); border: 1px solid var(--line); border-top: 3px solid var(--brand); border-radius: var(--radius); padding: 1.25rem; box-shadow: var(--shadow); }
.panel h2 { font-size: 1.05rem; margin: 0 0 .75rem; color: var(--heading-accent); }

/* ---------- Forms ---------- */
.fields { display: grid; grid-template-columns: 1fr 1fr; gap: .9rem .75rem; }
.field { display: flex; flex-direction: column; gap: .25rem; min-width: 0; }
.field.full { grid-column: 1 / -1; }
label, .label { font-weight: 600; font-size: .92rem; color: var(--ink); }
.help { font-size: .82rem; color: var(--muted); margin: 0; }
input[type=text], input[type=number], input[type=email], input[type=url], select, textarea {
  font: inherit; color: var(--ink); background: var(--field-bg); border: 1px solid var(--line);
  border-radius: var(--radius-sm); padding: .45rem .6rem; width: 100%;
}
input:focus, select:focus, textarea:focus { border-color: var(--brand); }
input:disabled, select:disabled { opacity: .6; }
input[type=range] { width: 100%; accent-color: var(--accent); }
input[type=checkbox], input[type=radio] { accent-color: var(--accent); width: 1.05rem; height: 1.05rem; margin: 0; }
input[type=color] { width: 2.4rem; height: 2rem; border: 1px solid var(--line); border-radius: var(--radius-sm); padding: 2px; background: var(--field-bg); }
.row { display: flex; align-items: center; gap: .55rem; }
.row label { font-weight: 400; }
output { font-variant-numeric: tabular-nums; color: var(--muted); }

/* Drop zone for file inputs */
.drop {
  position: relative; display: block; border: 2px dashed color-mix(in srgb, var(--brand) 40%, var(--line)); border-radius: var(--radius);
  background: var(--brand-tint);
  padding: 1.25rem 1rem; text-align: center; cursor: pointer; transition: border-color .15s, background .15s;
}
.drop:hover, .drop.over { border-color: var(--brand); background: color-mix(in srgb, var(--brand) 14%, var(--brand-tint)); }
.drop:focus-within { outline: 3px solid var(--brand-bright); outline-offset: 2px; }
.drop input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.drop strong { display: block; color: var(--ink); }
.drop span { color: var(--muted); font-size: .9rem; }

/* ---------- Buttons ---------- */
button, .btn {
  font: inherit; font-weight: 600; border-radius: var(--radius-pill); padding: .6rem 1.25rem; cursor: pointer;
  border: 1px solid var(--btn-bg); background: var(--btn-bg); color: var(--btn-ink);
  display: inline-flex; align-items: center; justify-content: center; gap: .4rem; text-decoration: none;
  transition: background .15s, border-color .15s, color .15s;
}
button:hover:not(:disabled), .btn:hover { background: var(--btn-hover); border-color: var(--btn-hover); color: var(--btn-ink); }
button.secondary, .btn.secondary { background: transparent; color: var(--accent); border-color: var(--accent); }
button.secondary:hover:not(:disabled), .btn.secondary:hover { background: color-mix(in srgb, var(--accent) 10%, transparent); color: var(--accent); }
button.small, .btn.small { padding: .35rem .8rem; font-size: .88rem; }
button:disabled { opacity: .45; cursor: not-allowed; }
.actions { display: flex; gap: .6rem; flex-wrap: wrap; }

/* Segmented control: buttons with aria-pressed inside .seg */
.seg { display: inline-flex; border: 1px solid var(--line); border-radius: var(--radius-pill); overflow: hidden; }
.seg button { border: 0; border-radius: 0; background: transparent; color: var(--ink); font-weight: 400; padding: .35rem .85rem; font-size: .88rem; }
.seg button:hover:not(:disabled) { background: color-mix(in srgb, var(--accent) 10%, transparent); color: var(--ink); }
.seg button + button { border-left: 1px solid var(--line); }
.seg button[aria-pressed="true"], .seg button[aria-pressed="true"]:hover { background: var(--btn-bg); color: var(--btn-ink); font-weight: 600; }

/* ---------- Feedback ---------- */
.progress .bar { height: 6px; background: var(--subtle); border-radius: 3px; overflow: hidden; border: 1px solid var(--line); }
.progress .bar i { display: block; height: 100%; width: 0; background: linear-gradient(90deg, var(--brand), var(--brand-bright)); transition: width .1s linear; }
.status { font-size: .9rem; margin: .5rem 0 0; min-height: 1.4em; }
.notice { background: var(--warn-bg); color: var(--warn); border-radius: var(--radius-sm); padding: .6rem .75rem; font-size: .88rem; margin: 1rem 0 0; }
.notice.ok { background: var(--ok-bg); color: var(--ok); }

/* ---------- Site footer ----------
   Matches the WordPress (Avada) copyright bar exactly: dark bar, one centred line,
   18px text at 40% white. Same settings as Avada's copyright area. */
.site-footer { background: #1D242D; color: rgba(255, 255, 255, .4); font-family: var(--font-heading); font-size: 18px; line-height: 1.8; text-align: center; }
.site-footer .wrap { padding-top: 20px; padding-bottom: 20px; }
.site-footer p { margin: 0; }
@media (max-width: 800px) { .site-footer p { padding-bottom: 15px; } } /* Avada adds this on narrow screens only */
.site-footer a { color: rgba(255, 255, 255, .8); }
.site-footer a:hover { color: var(--brand-mid); }

@media (prefers-reduced-motion: reduce) { *, *::before, *::after { transition: none !important; animation: none !important; } }

/* ---------- Tool cards (homepage) ---------- */
.section-intro { max-width: 68ch; margin: 0 0 1.5rem; }
.section-intro h2 { font-size: 1.5rem; margin: 0 0 .4rem; }
.section-intro p { margin: 0; color: var(--muted); }
.tool-grid { list-style: none; margin: 0; padding: 0; display: grid; gap: 1.25rem; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); }
.tool-card {
  position: relative; display: flex; flex-direction: column; gap: .6rem; height: 100%;
  background: var(--panel); border: 1px solid var(--line); border-top: 3px solid var(--brand);
  border-radius: var(--radius); padding: 1.4rem 1.25rem 1.25rem; box-shadow: var(--shadow);
  transition: transform .15s, box-shadow .15s;
}
.tool-card:hover, .tool-card:focus-within { transform: translateY(-3px); box-shadow: 0 2px 4px rgba(33, 41, 52, .08), 0 10px 28px rgba(33, 41, 52, .12); }
.tool-card .icon { display: grid; place-items: center; width: 52px; height: 52px; border-radius: 50%; background: var(--brand-tint); color: var(--brand); }
.tool-card .icon svg { width: 26px; height: 26px; }
.tool-card h3 { font-size: 1.15rem; margin: .2rem 0 0; }
.tool-card h3 a { color: var(--ink); text-decoration: none; }
.tool-card h3 a::after { content: ""; position: absolute; inset: 0; border-radius: var(--radius); } /* whole card is the link */
.tool-card h3 a:focus-visible { outline: none; }
.tool-card h3 a:focus-visible::after { outline: 3px solid var(--brand-bright); outline-offset: 2px; }
.tool-card p { margin: 0; color: var(--text); font-size: .95rem; flex: 1; }
.tool-card .more { font-family: var(--font-heading); font-weight: 600; font-size: .92rem; color: var(--brand); }
.badge { align-self: flex-start; font-size: .78rem; font-weight: 600; border-radius: var(--radius-pill); padding: .15rem .65rem; background: var(--ok-bg); color: var(--ok); }
.badge.soon { background: var(--subtle); color: var(--muted); }

/* Quiet band for supporting content */
.band { background: var(--subtle); }
.band .wrap { padding-top: 2.5rem; padding-bottom: 2.5rem; }
.points { list-style: none; margin: 0; padding: 0; display: grid; gap: 1.25rem; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); }
.points h3 { font-size: 1rem; margin: 0 0 .3rem; color: var(--brand); }
.points p { margin: 0; font-size: .93rem; }

/* ---------- Placeholder for tools still being built ---------- */
.placeholder { max-width: 640px; margin: 1rem auto; text-align: center; }
.placeholder .icon { display: grid; place-items: center; width: 64px; height: 64px; margin: 0 auto 1rem; border-radius: 50%; background: var(--brand-tint); color: var(--brand); }
.placeholder .icon svg { width: 30px; height: 30px; }
.placeholder h2 { font-size: 1.25rem; margin: 0 0 .5rem; }
.placeholder p { margin: 0 0 1rem; }
.placeholder .actions { justify-content: center; }

/* Card thumbnails: full-width image across the top of a tool card (1200 x 628 artwork) */
.tool-card .thumb {
  display: block; width: calc(100% + 2.5rem); max-width: none; height: auto; aspect-ratio: 1200 / 628; object-fit: cover;
  margin: -1.4rem -1.25rem .4rem; border-radius: calc(var(--radius) - 1px) calc(var(--radius) - 1px) 0 0;
}
/* Stand-in for a tool without artwork yet */
.tool-card .thumb-icon { display: grid; place-items: center; background: linear-gradient(135deg, var(--brand) 0%, var(--brand-mid) 100%); color: #FFFFFF; }
.tool-card .thumb-icon svg { width: 25%; height: auto; }

/* ---------- Shared tool parts ---------- */
/* Panel heading row with a count or status on the right */
.list-head { display: flex; justify-content: space-between; align-items: baseline; gap: .5rem; flex-wrap: wrap; }
.list-head h2 { margin: 0; }
.count { color: var(--muted); font-size: .9rem; }
/* Square icon button; add .del for remove or delete actions */
.icon-btn { flex-shrink: 0; width: 2.2rem; height: 2.2rem; padding: 0; background: var(--panel); color: var(--muted); border-color: var(--line); }
.icon-btn:hover:not(:disabled) { background: var(--brand-tint); color: var(--brand); border-color: var(--brand); }
.icon-btn.del:hover:not(:disabled) { background: var(--warn-bg); color: var(--warn); border-color: var(--warn); }
.icon-btn svg { width: 16px; height: 16px; }

/* ---------- Questions and answers, and links to other tools (end of each tool page) ---------- */
.faq { margin-top: 2rem; }
.faq h3 { font-size: 1rem; margin: 1.1rem 0 .3rem; color: var(--ink); }
.faq p { margin: 0; }
.more-tools { margin-top: 1.5rem; }
.more-tools h2 { font-size: 1.1rem; margin: 0 0 .5rem; }
.more-tools ul { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: .5rem; }
.more-tools a { display: inline-block; padding: .4rem .9rem; border: 1px solid var(--line); border-radius: var(--radius-pill); text-decoration: none; font-weight: 600; font-size: .9rem; }
.more-tools a:hover { border-color: var(--brand); background: var(--brand-tint); }
