/*
Theme Name: Shairi — Urdu Poetry Treat
Theme URI: https://example.com
Author: Mahnoor
Author URI: https://example.com
Description: A cinematic, single-page literary tribute to Urdu poetry — Ghalib, Mir, Iqbal, Parveen Shakir, Jaun Elia, and the recitations of Zia Mohyeddin. Built with scroll-driven motion, an interactive flipping diwan card, and Nastaliq typography.
Version: 1.0
Requires at least: 5.9
Requires PHP: 7.4
License: GNU General Public License v2 or later
License URI: https://www.gnu.org/licenses/gpl-2.0.html
Text Domain: shairi
*/


  :root {
    --parchment: #F1E7D2;
    --parchment-dark: #E7D8B6;
    --maroon: #6B1420;
    --maroon-deep: #4A0D16;
    --ink: #241B14;
    --gold: #B9902E;
    --gold-bright: #D4AF52;
    --rose-dust: #A9605A;
    --line: #CBB588;
    --paper-shadow: rgba(36, 27, 20, 0.18);
  }

  * { box-sizing: border-box; margin: 0; padding: 0; }
  html { scroll-behavior: smooth; }

  body {
    background: var(--parchment);
    color: var(--ink);
    font-family: 'EB Garamond', serif;
    overflow-x: hidden;
    position: relative;
    background-image:
      radial-gradient(ellipse at top left, rgba(107,20,32,0.05), transparent 55%),
      radial-gradient(ellipse at bottom right, rgba(185,144,46,0.07), transparent 55%);
  }

  .urdu { font-family: 'Noto Nastaliq Urdu', serif; direction: rtl; unicode-bidi: isolate; }
  ::selection { background: var(--gold); color: var(--parchment); }
  a { color: inherit; }

  /* ---------- texture overlay ---------- */
  .grain {
    position: fixed; inset: 0; pointer-events: none; z-index: 998;
    opacity: 0.05; mix-blend-mode: multiply;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='120' height='120'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='2' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
  }

  /* ---------- ambient floating glyphs ---------- */
  .ambient { position: fixed; inset: 0; pointer-events: none; z-index: 0; overflow: hidden; }
  .glyph {
    position: absolute;
    font-family: 'Noto Nastaliq Urdu', serif;
    color: var(--gold);
    opacity: 0.06;
    animation: driftUp linear infinite;
    user-select: none;
  }
  @keyframes driftUp {
    0% { transform: translateY(110vh) rotate(0deg); }
    100% { transform: translateY(-15vh) rotate(8deg); }
  }

  /* ---------- scroll progress ---------- */
  .progress-bar {
    position: fixed; top: 0; left: 0; height: 2.5px; width: 0%;
    background: linear-gradient(to right, var(--gold), var(--maroon));
    z-index: 1001; transition: width 0.1s ease-out;
  }

  /* ---------- sticky nav ---------- */
  .nav {
    position: fixed; top: 0; left: 0; right: 0; z-index: 1000;
    display: flex; justify-content: center; gap: clamp(0.8rem, 2vw, 2.1rem);
    padding: 1.1rem 2vw;
    background: rgba(241, 231, 210, 0.88);
    backdrop-filter: blur(10px);
    border-bottom: 1px solid var(--line);
    transform: translateY(-110%);
    transition: transform 0.6s cubic-bezier(.4,.2,.2,1);
    flex-wrap: wrap;
  }
  .nav.show { transform: translateY(0); }
  .nav a {
    font-family: 'EB Garamond', serif;
    font-size: 0.72rem;
    letter-spacing: 0.16em;
    text-transform: uppercase;
    text-decoration: none;
    color: var(--ink);
    opacity: 0.6;
    position: relative;
    padding-bottom: 3px;
    transition: opacity 0.3s ease, color 0.3s ease;
    white-space: nowrap;
  }
  .nav a::after {
    content: ''; position: absolute; left: 0; bottom: 0; height: 1px; width: 0;
    background: var(--gold); transition: width 0.35s ease;
  }
  .nav a:hover, .nav a.active { opacity: 1; color: var(--maroon-deep); }
  .nav a.active::after, .nav a:hover::after { width: 100%; }

  /* ---------- scroll reveal ---------- */
  .reveal { opacity: 0; transform: translateY(26px); transition: opacity 0.9s ease, transform 0.9s ease; }
  .reveal.in { opacity: 1; transform: translateY(0); }
  .stagger > * { opacity: 0; transform: translateY(18px); transition: opacity 0.7s ease, transform 0.7s ease; }
  .stagger.in > * { opacity: 1; transform: translateY(0); }
  .stagger.in > *:nth-child(1) { transition-delay: 0.05s; }
  .stagger.in > *:nth-child(2) { transition-delay: 0.16s; }
  .stagger.in > *:nth-child(3) { transition-delay: 0.27s; }
  .stagger.in > *:nth-child(4) { transition-delay: 0.38s; }

  @media (prefers-reduced-motion: reduce) {
    .reveal, .stagger > * { opacity: 1; transform: none; transition: none; }
    html { scroll-behavior: auto; }
    .glyph { animation: none; opacity: 0.04; }
  }

  main { position: relative; z-index: 1; }

  /* ================= HERO ================= */
  .hero {
    min-height: 100vh; display: flex; flex-direction: column;
    align-items: center; justify-content: center; text-align: center;
    padding: 6vh 6vw; position: relative;
  }
  .hero-eyebrow {
    font-style: italic; letter-spacing: 0.35em; text-transform: uppercase;
    font-size: 0.72rem; color: var(--maroon); margin-bottom: 2.2rem; opacity: 0;
    animation: fadeUp 1s ease forwards 0.2s;
  }
  .hero-title {
    font-family: 'Noto Nastaliq Urdu', serif;
    font-size: clamp(4.5rem, 14vw, 9.5rem);
    line-height: 1.35; color: var(--maroon-deep); direction: rtl;
    opacity: 0; animation: titleBloom 1.4s cubic-bezier(.2,.7,.3,1) forwards 0.4s;
  }
  @keyframes titleBloom {
    0% { opacity: 0; transform: scale(0.92); filter: blur(6px); }
    100% { opacity: 1; transform: scale(1); filter: blur(0); text-shadow: 0 2px 22px rgba(185,144,46,0.25); }
  }
  .hero-sub {
    margin-top: 1.6rem; font-family: 'Cormorant Garamond', serif; font-style: italic;
    font-weight: 500; font-size: clamp(1.2rem, 2.4vw, 1.6rem); color: var(--ink);
    letter-spacing: 0.02em; opacity: 0; animation: fadeUp 1s ease forwards 1.1s;
  }
  .hero-rule {
    width: 140px; height: 2px; margin: 2.4rem auto;
    background: linear-gradient(to right, transparent, var(--gold), transparent);
    position: relative; opacity: 0; animation: fadeUp 1s ease forwards 1.4s;
  }
  .hero-rule::before {
    content: "❖"; position: absolute; top: 50%; left: 50%; transform: translate(-50%, -50%);
    background: var(--parchment); padding: 0 10px; color: var(--gold); font-size: 0.9rem;
  }
  .hero-note {
    max-width: 460px; font-size: 1rem; line-height: 1.75; color: var(--ink); opacity: 0;
    animation: fadeUp 1s ease forwards 1.6s;
  }
  @keyframes fadeUp { from { opacity: 0; transform: translateY(16px); } to { opacity: 0.75; transform: translateY(0); } }
  .hero-eyebrow, .hero-sub { animation-fill-mode: forwards; }

  .scroll-cue {
    position: absolute; bottom: 5vh; font-size: 0.7rem; letter-spacing: 0.3em;
    text-transform: uppercase; color: var(--maroon); opacity: 0.6;
    display: flex; flex-direction: column; align-items: center; gap: 0.6rem;
  }
  .scroll-cue span.stem { width: 1px; height: 34px; background: var(--maroon); animation: stemPulse 2.2s ease-in-out infinite; }
  @keyframes stemPulse { 0%, 100% { transform: scaleY(1); opacity: 0.6; } 50% { transform: scaleY(0.6); opacity: 1; } }

  /* ================= SECTION SHELL ================= */
  section { padding: 9vh 6vw; max-width: 1000px; margin: 0 auto; scroll-margin-top: 90px; }
  .section-head { text-align: center; margin-bottom: 4.5rem; }
  .section-head .kicker {
    font-style: italic; letter-spacing: 0.3em; text-transform: uppercase; font-size: 0.68rem;
    color: var(--rose-dust); display: block; margin-bottom: 0.9rem;
  }
  .section-head h2 { font-family: 'Noto Nastaliq Urdu', serif; font-size: clamp(2.2rem, 5vw, 3.2rem); color: var(--maroon-deep); direction: rtl; }
  .section-head p { margin-top: 0.9rem; font-family: 'Cormorant Garamond', serif; font-style: italic; font-size: 1.15rem; color: var(--ink); opacity: 0.7; }

  /* ================= FEATURED COUPLET (diwan flip) ================= */
  .featured-wrap { display: flex; flex-direction: column; align-items: center; gap: 1.6rem; position: relative; }
  .diwan { width: min(640px, 100%); aspect-ratio: 5 / 3.6; perspective: 1800px; cursor: pointer; position: relative; }

  .mote { position: absolute; width: 4px; height: 4px; border-radius: 50%; background: var(--gold); opacity: 0; animation: moteFloat 5s ease-in infinite; }
  @keyframes moteFloat { 0% { opacity: 0; transform: translateY(0) scale(0.5); } 15% { opacity: 0.7; } 100% { opacity: 0; transform: translateY(-90px) scale(1.1); } }

  .diwan-inner { position: relative; width: 100%; height: 100%; transition: transform 1.1s cubic-bezier(.4,.2,.2,1); transform-style: preserve-3d; }
  .diwan.flipped .diwan-inner { transform: rotateY(180deg); }
  .diwan-face {
    position: absolute; inset: 0; backface-visibility: hidden; border: 1px solid var(--gold); border-radius: 2px;
    background: linear-gradient(160deg, var(--parchment) 0%, var(--parchment-dark) 100%);
    box-shadow: 0 18px 40px var(--paper-shadow), inset 0 0 0 6px var(--parchment), inset 0 0 0 7px var(--gold);
    display: flex; flex-direction: column; align-items: center; justify-content: center; padding: 2.4rem 2rem; text-align: center;
    transition: box-shadow 0.4s ease;
  }
  .diwan:hover .diwan-face { box-shadow: 0 22px 50px var(--paper-shadow), inset 0 0 0 6px var(--parchment), inset 0 0 0 7px var(--gold-bright); }
  .diwan-face .corner { position: absolute; width: 26px; height: 26px; border: 1.5px solid var(--gold); opacity: 0.7; }
  .corner.tl { top: 14px; left: 14px; border-right: none; border-bottom: none; }
  .corner.tr { top: 14px; right: 14px; border-left: none; border-bottom: none; }
  .corner.bl { bottom: 14px; left: 14px; border-right: none; border-top: none; }
  .corner.br { bottom: 14px; right: 14px; border-left: none; border-top: none; }
  .diwan-face .sher-urdu { font-family: 'Noto Nastaliq Urdu', serif; font-size: clamp(1.5rem, 3.4vw, 2.15rem); line-height: 2.15; color: var(--maroon-deep); }
  .diwan-back .sher-en { font-family: 'Cormorant Garamond', serif; font-style: italic; font-size: clamp(1.15rem, 2.4vw, 1.5rem); line-height: 1.7; color: var(--ink); max-width: 480px; }
  .diwan-back .sher-translit { margin-top: 1rem; font-size: 0.85rem; letter-spacing: 0.03em; color: var(--rose-dust); }
  .diwan-face .attr { margin-top: 1.4rem; font-size: 0.75rem; letter-spacing: 0.25em; text-transform: uppercase; color: var(--gold); }
  .diwan-back { transform: rotateY(180deg); }
  .diwan-hint { font-family: 'Cormorant Garamond', serif; font-style: italic; font-size: 0.82rem; color: var(--ink); opacity: 0.55; }

  .shuffle-btn {
    margin-top: 0.4rem; font-size: 0.78rem; letter-spacing: 0.18em; text-transform: uppercase;
    background: none; border: 1px solid var(--gold); color: var(--maroon-deep);
    padding: 0.7rem 1.6rem; cursor: pointer; transition: background 0.35s ease, color 0.35s ease, transform 0.3s ease;
  }
  .shuffle-btn:hover { background: var(--maroon-deep); color: var(--parchment); transform: translateY(-2px); }
  .shuffle-btn:focus-visible, .diwan:focus-visible { outline: 2px solid var(--maroon); outline-offset: 4px; }

  /* ================= POET SECTIONS ================= */
  .poet { margin-bottom: 6rem; }
  .poet-header { display: flex; align-items: center; gap: 1.6rem; margin-bottom: 2.2rem; border-bottom: 1px solid var(--line); padding-bottom: 1.6rem; }
  .poet-seal {
    flex-shrink: 0; width: 68px; height: 68px; border-radius: 50%; border: 1.5px solid var(--gold);
    display: flex; align-items: center; justify-content: center; font-family: 'Noto Nastaliq Urdu', serif;
    font-size: 1.5rem; color: var(--maroon-deep); background: radial-gradient(circle, var(--parchment-dark), var(--parchment));
    transition: transform 0.5s ease, box-shadow 0.5s ease;
  }
  .poet-header:hover .poet-seal { transform: rotate(8deg) scale(1.06); box-shadow: 0 6px 18px var(--paper-shadow); }
  .poet-titles h3 { font-family: 'Noto Nastaliq Urdu', serif; font-size: clamp(1.6rem, 3vw, 2.1rem); color: var(--maroon-deep); direction: rtl; }
  .poet-titles .roman-name { font-family: 'Cormorant Garamond', serif; font-style: italic; font-size: 1rem; color: var(--rose-dust); letter-spacing: 0.04em; }
  .poet-bio { font-family: 'Cormorant Garamond', serif; font-size: 1.08rem; line-height: 1.75; color: var(--ink); opacity: 0.85; max-width: 640px; margin-bottom: 2.4rem; }

  .couplet {
    display: grid; grid-template-columns: 1fr; gap: 0.4rem; padding: 1.8rem 0.6rem;
    border-top: 1px dashed var(--line); cursor: pointer; transition: background 0.4s ease, padding-left 0.4s ease;
    position: relative; margin: 0 -0.6rem;
  }
  .poet .couplet:last-child { border-bottom: 1px dashed var(--line); }
  .couplet:hover { background: rgba(185,144,46,0.06); padding-left: 1.2rem; }
  .couplet-urdu { font-family: 'Noto Nastaliq Urdu', serif; font-size: clamp(1.3rem, 2.8vw, 1.75rem); line-height: 2; color: var(--maroon-deep); direction: rtl; }
  .couplet-meta { max-height: 0; overflow: hidden; transition: max-height 0.6s ease, opacity 0.5s ease, margin 0.5s ease; opacity: 0; }
  .couplet.open .couplet-meta { max-height: 200px; opacity: 1; margin-top: 0.9rem; }
  .couplet-translit { font-style: italic; font-size: 0.92rem; color: var(--rose-dust); margin-bottom: 0.5rem; }
  .couplet-en { font-family: 'Cormorant Garamond', serif; font-size: 1.05rem; color: var(--ink); line-height: 1.6; }
  .couplet-cue { font-size: 0.68rem; letter-spacing: 0.2em; text-transform: uppercase; color: var(--gold); opacity: 0.75; }

  /* ---- legacy-only voices (Parveen Shakir / Jaun Elia / Zia Mohyeddin) ---- */
  .voice-note {
    font-family: 'EB Garamond', serif; font-style: italic; font-size: 0.85rem; color: var(--rose-dust);
    border-left: 2px solid var(--gold); padding-left: 1rem; margin-bottom: 1.8rem; opacity: 0.85; max-width: 600px;
  }
  .theme-row { display: flex; flex-wrap: wrap; gap: 0.7rem; }
  .theme-pill {
    font-size: 0.78rem; letter-spacing: 0.05em; padding: 0.55rem 1.1rem; border: 1px solid var(--line);
    border-radius: 999px; color: var(--maroon-deep); background: rgba(241,231,210,0.5);
    transition: border-color 0.35s ease, transform 0.35s ease, background 0.35s ease;
  }
  .theme-pill:hover { border-color: var(--gold); transform: translateY(-2px); background: rgba(185,144,46,0.1); }

  /* ---- tribute / recited couplet card (clearly not the poet's own archived work) ---- */
  .tribute {
    margin-top: 1.6rem;
    padding: 1.8rem 2rem;
    border: 1px dashed var(--gold);
    background: rgba(185,144,46,0.05);
    border-radius: 2px;
  }
  .tribute-label {
    display: block;
    font-size: 0.68rem;
    letter-spacing: 0.2em;
    text-transform: uppercase;
    font-style: italic;
    color: var(--rose-dust);
    margin-bottom: 1rem;
  }
  .tribute .couplet-urdu { margin-bottom: 0.8rem; }
  .tribute .couplet-translit { display: block; margin-bottom: 0.5rem; }
  .tribute .couplet-en { display: block; }

  /* ================= ABOUT ================= */
  .about { background: var(--maroon-deep); color: var(--parchment); border-radius: 2px; padding: 5rem 6vw; position: relative; overflow: hidden; }
  .about::before {
    content: ""; position: absolute; inset: 0; opacity: 0.06; pointer-events: none;
    background: repeating-linear-gradient(45deg, var(--gold-bright) 0, var(--gold-bright) 1px, transparent 1px, transparent 60px);
  }
  .about .section-head h2 { color: var(--gold-bright); }
  .about .section-head p { color: var(--parchment); opacity: 0.75; }
  .about-text { max-width: 680px; margin: 0 auto; font-family: 'Cormorant Garamond', serif; font-size: 1.15rem; line-height: 1.85; text-align: center; opacity: 0.92; position: relative; }
  .about-text strong { color: var(--gold-bright); font-weight: 500; }

  /* ================= FOOTER ================= */
  footer { text-align: center; padding: 5rem 6vw 4rem; }
  footer .urdu { font-size: 1.5rem; color: var(--maroon-deep); margin-bottom: 0.8rem; }
  footer .credit { font-size: 0.78rem; letter-spacing: 0.15em; text-transform: uppercase; color: var(--ink); opacity: 0.55; }

  @media (max-width: 640px) {
    .poet-header { flex-direction: column; align-items: flex-start; }
    section { padding: 7vh 7vw; }
    .nav { justify-content: flex-start; overflow-x: auto; }
  }
