/* ============================================================================
   mesenaatti.me — info.css   (info / guide / ohjeet pages)
   ----------------------------------------------------------------------------
   Drop-in stylesheet for the SEO-optimised /info/ohjeet2/ guide pages.
   Load AFTER /css/style.css (legacy) and tokens.css. Scoped to
   .info-guide so it never bleeds into campaign / pledge / listing views.

   DOM contract — the only HTML change vs. WordPress default is wrapping each
   chapter (h2 + sub-list) in <article class="info-card"> with a numeric
   data-num. Everything else is the WordPress block-editor output.

       <main class="info-guide">
         <header class="info-hero">
           <p class="info-eyebrow">Ohjeet</p>
           <h1>Onnistuneen kampanjan käsikirja</h1>
           <p class="info-lede">…</p>
         </header>

         <ol class="info-cards">
           <li><article class="info-card" data-num="01">
             <a href="#suunnittelu">
               <h2>Kampanjan suunnittelu</h2>
               <ul>
                 <li>Kampanjan idea</li>
                 <li>Tavoitesumma</li>
                 <li>Aikataulu</li>
               </ul>
             </a>
           </article></li>
           …
         </ol>
       </main>

   If you can't change the markup at all, the companion snippet in
   info.html shows a ~12-line wrapper script that wraps each h2 + ul
   pair on DOMContentLoaded — same pattern as the campaign hamburger
   injection.

   Design pillars (carried over from tokens.css):
   - Sharp edges, no rounded corners
   - One decisive offset shadow as the signature elevation
   - Cyan headings, orange accents, ink-black body type
   - Adelle Basic / Zilla Slab display, Source Sans 3 body
   - Mobile-first; grid scales 1 → 2 → 3 columns at the tokens.css breakpoints
   ============================================================================ */


/* ============================================================================
   1. PAGE CANVAS
   ============================================================================ */
.info-guide {
  --info-card-gap: 14px;
  --info-card-pad: 22px;
  --info-card-bg: var(--ms-paper, #fff);
  --info-card-border: var(--ms-ink-200, #e5e4dd);
  --info-card-border-hover: var(--ms-ink-1000, #111);
  --info-card-shadow: 0 2px 0 0 var(--ms-ink-1000, #111);
  --info-card-shadow-hover: 0 6px 0 0 var(--ms-ink-1000, #111);
  --info-num-color: var(--ms-cyan-600, #00bcca);
  --info-rule-color: var(--ms-orange-500, #ec6f2b);

  display: block;
  max-width: 1120px;
  margin: 0 auto;
  padding: 0 16px 80px;
  color: var(--fg-1, #111);
  font-family: var(--font-sans, "Source Sans 3", system-ui, sans-serif);
  box-sizing: border-box;
}


/* ============================================================================
   2. HERO  —  eyebrow, headline, lede
   ----------------------------------------------------------------------------
   Generous top whitespace, slab-serif headline that text-wraps balanced,
   a thin orange rule under the eyebrow to echo the cards' accent.
   ============================================================================ */
.info-guide .info-hero {
  padding: 48px 0 32px;
  border-bottom: 1px solid var(--ms-ink-200, #e5e4dd);
  margin-bottom: 24px;
}

.info-guide .info-eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  margin: 0 0 16px;
  padding: 0;
  font-family: var(--font-sans);
  font-size: 12px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.14em;
  color: var(--ms-ink-700, #403f3b);
}
.info-guide .info-eyebrow::before {
  content: "";
  display: inline-block;
  width: 28px;
  height: 2px;
  background: var(--ms-orange-500, #ec6f2b);
}

.info-guide .info-hero h1 {
  font-family: var(--font-display, "Adelle Basic", "Zilla Slab", Georgia, serif);
  font-size: clamp(32px, 5.4vw, 56px);
  line-height: 1.04;
  letter-spacing: -0.015em;
  font-weight: 600;
  color: var(--ms-ink-1000, #111);
  margin: 0 0 16px;
  max-width: 18ch;
  text-wrap: balance;
}

.info-guide .info-lede {
  font-family: var(--font-sans);
  font-size: clamp(16px, 2.2vw, 19px);
  line-height: 1.5;
  color: var(--ms-ink-700, #403f3b);
  max-width: 56ch;
  margin: 0;
  text-wrap: pretty;
}


/* ============================================================================
   3. CARDS GRID
   ----------------------------------------------------------------------------
   auto-fill keeps the layout fluid: 1 col on mobile, 2 col around 640px,
   3 col above ~960px. Density tightens deliberately so a phone shows the
   full guide on roughly one and a half screens of scroll — fewer steps
   to "what's the whole flow look like?"
   ============================================================================ */
.info-guide .info-cards {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: var(--info-card-gap);
  counter-reset: info-card;
}

.info-guide .info-cards > li {
  display: flex;     /* lets <article> stretch to row height */
}


/* ============================================================================
   4. INFO CARD
   ----------------------------------------------------------------------------
   The signature "card" component for this page. Sharp edges. Hairline
   border in the surface tone. One decisive offset shadow as the resting
   state — lifts further on hover. The number is the visual hook (cyan,
   slab-serif, tabular). The title is uppercase display; an orange rule
   sits beneath it as an accent the eye tracks across all six cards.
   ============================================================================ */
.info-guide .info-card {
  position: relative;
  display: flex;
  flex: 1 1 auto;
  width: 100%;
  background: var(--info-card-bg);
  border: 1px solid var(--info-card-border);
  box-shadow: var(--info-card-shadow);
  box-sizing: border-box;
  transition:
    transform var(--dur-base, 200ms) var(--ease-out, cubic-bezier(.2,.7,.2,1)),
    box-shadow var(--dur-base, 200ms) var(--ease-out, cubic-bezier(.2,.7,.2,1)),
    border-color var(--dur-fast, 120ms) var(--ease-out, cubic-bezier(.2,.7,.2,1));
  counter-increment: info-card;
}

.info-guide .info-card > a,
.info-guide .info-card > .info-card__body {
  display: flex;
  flex-direction: column;
  flex: 1 1 auto;
  padding: var(--info-card-pad);
  text-decoration: none;
  color: inherit;
  border: 0;
  outline: 0;
  width: 100%;
  box-sizing: border-box;
}

/* The big numbered hook — generated from the CSS counter so author
   markup stays clean (no "01 " stuck into the link's accessible name).
   `decimal-leading-zero` gives 01 → 09 automatically. */
.info-guide .info-card > a::before,
.info-guide .info-card > .info-card__body::before {
  content: counter(info-card, decimal-leading-zero);
  display: block;
  font-family: var(--font-display, "Adelle Basic", "Zilla Slab", Georgia, serif);
  font-size: 40px;
  line-height: 1;
  letter-spacing: -0.02em;
  color: var(--info-num-color);
  font-variant-numeric: tabular-nums;
  font-weight: 600;
  margin: 0 0 18px;
}

/* Card title */
.info-guide .info-card h2,
.info-guide .info-card h3 {
  font-family: var(--font-display, "Adelle Basic", "Zilla Slab", Georgia, serif);
  font-size: 19px;
  line-height: 1.15;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.005em;
  color: var(--ms-ink-1000, #111);
  margin: 0 0 12px;
  padding: 0 0 12px;
  border-bottom: 2px solid var(--info-rule-color);
  text-wrap: balance;
  /* the underline only spans the title's intrinsic width */
  align-self: flex-start;
  max-width: 100%;
}

/* Sub-item list */
.info-guide .info-card ul {
  list-style: none;
  margin: 0;
  padding: 0;
  flex: 1 1 auto;
}
.info-guide .info-card ul li {
  position: relative;
  padding: 6px 0 6px 20px;
  font-size: 15px;
  line-height: 1.4;
  color: var(--ms-ink-700, #403f3b);
  border-top: 1px solid var(--ms-ink-100, #f3f2ec);
}
.info-guide .info-card ul li:first-child { border-top: 0; padding-top: 2px; }
.info-guide .info-card ul li::before {
  content: "";
  position: absolute;
  left: 0;
  top: 14px;
  width: 10px;
  height: 2px;
  background: var(--ms-cyan-500, #2cb6c7);
}

/* The CTA tail — "Lue ohje →". Authored or injected; if missing, the
   card is still a complete unit. */
.info-guide .info-card__cta {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  margin: 20px 0 0;
  font-family: var(--font-sans);
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--ms-orange-500, #ec6f2b);
  align-self: flex-start;
  transition: color var(--dur-fast, 120ms) var(--ease-out, cubic-bezier(.2,.7,.2,1));
}
.info-guide .info-card__cta::after {
  content: "→";
  font-size: 14px;
  transition: transform var(--dur-base, 200ms) var(--ease-out, cubic-bezier(.2,.7,.2,1));
}

/* Hover / focus — lifts via signature offset shadow, never softens the
   edges. */
.info-guide .info-card:hover,
.info-guide .info-card:focus-within {
  transform: translateY(-3px);
  box-shadow: var(--info-card-shadow-hover);
  border-color: var(--info-card-border-hover);
}
.info-guide .info-card:hover .info-card__cta,
.info-guide .info-card:focus-within .info-card__cta {
  color: var(--ms-cyan-700, #00939e);
}
.info-guide .info-card:hover .info-card__cta::after,
.info-guide .info-card:focus-within .info-card__cta::after {
  transform: translateX(4px);
}
.info-guide .info-card a:focus-visible {
  outline: 3px solid var(--ms-cyan-300, #83cfd9);
  outline-offset: 2px;
}


/* ============================================================================
   5. WIDE / NARROW VARIANTS  —  optional modifiers
   ----------------------------------------------------------------------------
   Add `.info-cards--dense` to the grid for 4-up on wide viewports, or
   `.info-cards--columns` for the editorial 2-up presentation.
   ============================================================================ */
.info-guide .info-cards--dense {
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
}
.info-guide .info-cards--columns {
  grid-template-columns: repeat(auto-fill, minmax(360px, 1fr));
}


/* ============================================================================
   6. RESPONSIVE  —  refine type & padding at the phone breakpoint
   ============================================================================ */
@media (max-width: 640px) {
  .info-guide { padding: 0 16px 64px; }
  .info-guide .info-hero { padding: 32px 0 24px; margin-bottom: 16px; }
  .info-guide .info-cards { gap: 12px; }
  .info-guide .info-card > a,
  .info-guide .info-card > .info-card__body { padding: 20px 18px; }
  .info-guide .info-card > a::before,
  .info-guide .info-card > .info-card__body::before { font-size: 34px; margin-bottom: 14px; }
  .info-guide .info-card h2,
  .info-guide .info-card h3 { font-size: 17px; }
  .info-guide .info-card ul li { font-size: 14.5px; }
}

@media (max-width: 380px) {
  .info-guide .info-hero h1 { font-size: 30px; }
  .info-guide .info-card > a::before,
  .info-guide .info-card > .info-card__body::before { font-size: 30px; }
}


/* ============================================================================
   7. PRINT  —  flatten into a clean printable handout
   ============================================================================ */
@media print {
  .info-guide .info-card {
    box-shadow: none;
    border: 1px solid #000;
    break-inside: avoid;
  }
  .info-guide .info-card:hover {
    transform: none;
    box-shadow: none;
  }
  .info-guide .info-card__cta { display: none; }
}
