/* ============================================================
   ECMES Academic Theme — Main Stylesheet
   ============================================================ */

@import url('https://fonts.googleapis.com/css2?family=Amiri:ital,wght@0,400;0,700;1,400&family=Playfair+Display:ital,wght@0,600;0,700;1,600&family=DM+Sans:wght@400;500;600&family=Scheherazade+New:wght@400;700&display=swap');

/* ============================================================
   Custom Properties
============================================================ */
:root {
  --bg:            #FAFAF8;
  --surface:       #FFFFFF;
  --surface-warm:  #F6F1E9;
  --text:          #1A1A1A;
  --text-muted:    #6A6A6A;
  --accent:        #8B6914;
  --accent-dark:   #5C440C;
  --accent-light:  #F0E6CC;
  --border:        #E4DED5;
  --border-light:  #F0EBE3;

  --font-heading:  'Playfair Display', 'Amiri', Georgia, serif;
  --font-arabic:   'Amiri', 'Scheherazade New', Georgia, serif;
  --font-body:     'Amiri', Georgia, serif;
  --font-ui:       'DM Sans', system-ui, sans-serif;

  --nav-h:        70px;
  --max-w:        1180px;
  --content-w:    760px;

  --r-sm: 4px;
  --r-md: 8px;
  --r-lg: 16px;

  --sh-sm: 0 2px 8px rgba(0,0,0,.06);
  --sh-md: 0 4px 20px rgba(0,0,0,.09);
  --sh-lg: 0 12px 40px rgba(0,0,0,.12);

  --t: .24s ease;
}

/* ============================================================
   Reset
============================================================ */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; -webkit-font-smoothing: antialiased; }

body {
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-body);
  font-size: 1.0625rem;
  line-height: 1.85;
  direction: rtl;
}
body.en { direction: ltr; font-family: 'Amiri', Georgia, serif; }

img { max-width: 100%; height: auto; display: block; }
a   { color: inherit; text-decoration: none; transition: color var(--t); }
a:hover { color: var(--accent); }
ul, ol { list-style: none; }
button { cursor: pointer; font-family: inherit; }

/* ============================================================
   Layout
============================================================ */
.wrap {
  width: 100%;
  max-width: var(--max-w);
  margin-inline: auto;
  padding-inline: 1.5rem;
}
.wrap--narrow { max-width: var(--content-w); }

.grid-2 { display: grid; grid-template-columns: repeat(2, 1fr); gap: 2rem; }
.grid-3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 2rem; }

/* ============================================================
   Typography Helpers
============================================================ */
h1,h2,h3,h4,h5,h6 {
  font-family: var(--font-heading);
  line-height: 1.3;
  color: var(--text);
}
h1 { font-size: clamp(2rem, 4vw, 3.25rem); }
h2 { font-size: clamp(1.6rem, 3vw, 2.5rem); }
h3 { font-size: clamp(1.25rem, 2vw, 1.75rem); }
h4 { font-size: 1.25rem; }

.section-label {
  display: inline-block;
  font-family: var(--font-ui);
  font-size: .7rem;
  font-weight: 600;
  letter-spacing: .14em;
  text-transform: uppercase;
  color: var(--accent);
  border-bottom: 2px solid var(--accent);
  padding-bottom: .25rem;
  margin-bottom: 1.25rem;
}
.meta {
  font-family: var(--font-ui);
  font-size: .8rem;
  color: var(--text-muted);
}
hr.divider {
  border: none;
  border-top: 1px solid var(--border);
  margin-block: 3rem;
}

/* ============================================================
   Header
============================================================ */
.site-header {
  position: sticky;
  top: 0;
  z-index: 200;
  height: var(--nav-h);
  background: rgba(255,255,255,.96);
  border-bottom: 1px solid var(--border);
  backdrop-filter: blur(10px);
  display: flex;
  align-items: center;
}
.site-header .wrap {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
}

/* Branding */
.site-branding { flex-shrink: 0; line-height: 1.2; }
.site-title {
  font-family: var(--font-heading);
  font-size: 1.3rem;
  font-weight: 700;
  color: var(--text);
  display: block;
}
.site-tagline {
  font-family: var(--font-ui);
  font-size: .7rem;
  color: var(--text-muted);
  letter-spacing: .05em;
}

/* Nav */
.nav-wrapper { display: flex; align-items: center; gap: .5rem; }

.primary-nav { display: block; }
.nav-menu {
  display: flex;
  align-items: center;
  gap: 0;
}
.nav-menu > li { position: relative; }
.nav-menu > li > a {
  display: flex;
  align-items: center;
  gap: 3px;
  font-family: var(--font-ui);
  font-size: .82rem;
  font-weight: 500;
  color: var(--text);
  padding: .45rem .85rem;
  white-space: nowrap;
  transition: color var(--t);
}
.nav-menu > li > a:hover,
.nav-menu > li.current-menu-item > a,
.nav-menu > li.current-menu-ancestor > a { color: var(--accent); }

.nav-arrow { font-size: .55em; transition: transform var(--t); opacity: .6; }
.nav-menu > li:hover > a .nav-arrow { transform: rotate(180deg); }

/* Dropdown */
.sub-menu {
  position: absolute;
  top: calc(100% + 6px);
  right: 0;
  min-width: 200px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--r-md);
  box-shadow: var(--sh-lg);
  padding: .4rem 0;
  opacity: 0;
  visibility: hidden;
  transform: translateY(-6px);
  transition: all var(--t);
  z-index: 300;
}
.nav-menu > li:hover .sub-menu {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
}
.sub-menu li a {
  font-family: var(--font-ui);
  font-size: .82rem;
  color: var(--text);
  padding: .45rem 1rem;
  display: block;
  transition: background var(--t), color var(--t);
}
.sub-menu li a:hover { background: var(--border-light); color: var(--accent); }

/* Nav Search */
.nav-search { position: relative; }
.nav-search-btn {
  background: none;
  border: none;
  color: var(--text);
  font-size: 1rem;
  padding: .4rem;
  transition: color var(--t);
}
.nav-search-btn:hover { color: var(--accent); }
.nav-search-form {
  display: none;
  position: absolute;
  top: 110%;
  left: 0;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--r-md);
  box-shadow: var(--sh-md);
  overflow: hidden;
  min-width: 240px;
}
.nav-search-form.is-open { display: block; }
.nav-search-form input {
  width: 100%;
  border: none;
  outline: none;
  padding: .7rem 1rem;
  font-family: var(--font-body);
  font-size: .9rem;
  background: transparent;
  color: var(--text);
  direction: rtl;
}

/* Hamburger */
.menu-toggle {
  display: none;
  background: none;
  border: 1px solid var(--border);
  border-radius: var(--r-sm);
  padding: .35rem .55rem;
  font-size: 1.1rem;
  color: var(--text);
}

/* ============================================================
   Hero / Quote Carousel
============================================================ */
.hero-section {
  background: var(--surface-warm);
  border-bottom: 1px solid var(--border);
  padding-block: 5rem 4.5rem;
  position: relative;
  overflow: hidden;
}
.hero-section::before {
  content: '';
  position: absolute;
  inset: 0;
  background:
    radial-gradient(ellipse 55% 70% at 85% 40%, rgba(139,105,20,.05) 0%, transparent 70%),
    radial-gradient(ellipse 35% 50% at 10% 80%, rgba(139,105,20,.04) 0%, transparent 70%);
  pointer-events: none;
}

.hero-inner {
  display: grid;
  grid-template-columns: 1fr 260px;
  gap: 4rem;
  align-items: center;
}

/* Quote slider */
.quote-carousel { position: relative; min-height: 200px; }
.quote-slide {
  position: absolute;
  inset: 0;
  opacity: 0;
  transition: opacity .7s ease;
  display: flex;
  flex-direction: column;
  justify-content: center;
}
.quote-slide.is-active { opacity: 1; position: relative; }

.quote-text {
  font-family: var(--font-arabic);
  font-size: clamp(1.2rem, 2.2vw, 1.6rem);
  line-height: 1.9;
  color: var(--text);
  font-style: italic;
  padding-right: 1.5rem;
  border-right: 3px solid var(--accent);
}
.quote-text::before { content: '«\00a0'; color: var(--accent); }
.quote-text::after  { content: '\00a0»'; color: var(--accent); }

.quote-author {
  margin-top: 1rem;
  font-family: var(--font-ui);
  font-size: .8rem;
  color: var(--text-muted);
  letter-spacing: .05em;
}

.carousel-dots {
  display: flex;
  gap: .5rem;
  margin-top: 1.5rem;
}
.carousel-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--border);
  border: none;
  padding: 0;
  transition: background var(--t), transform var(--t);
}
.carousel-dot.is-active {
  background: var(--accent);
  transform: scale(1.25);
}

/* Hero portrait */
.hero-portrait { position: relative; }
.hero-portrait img {
  width: 100%;
  border-radius: var(--r-lg);
  box-shadow: var(--sh-lg);
  object-fit: cover;
  aspect-ratio: 3/4;
}
.hero-portrait::before {
  content: '';
  position: absolute;
  inset: -8px;
  border: 1px solid var(--accent-light);
  border-radius: calc(var(--r-lg) + 8px);
  pointer-events: none;
}

/* ============================================================
   Homepage Content Grid
============================================================ */
.homepage-grid {
  padding-block: 4rem;
}
.homepage-grid .wrap {
  display: grid;
  grid-template-columns: 2fr 1fr;
  gap: 3rem;
}
.homepage-main { display: flex; flex-direction: column; gap: 3.5rem; }
.homepage-sidebar { display: flex; flex-direction: column; gap: 3rem; }

/* Content Blocks */
.content-block {}
.content-block__header {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  margin-bottom: 1.5rem;
  padding-bottom: 1rem;
  border-bottom: 1px solid var(--border);
}
.content-block__title {
  font-family: var(--font-heading);
  font-size: 1.05rem;
  font-weight: 700;
  color: var(--text);
  border-right: 3px solid var(--accent);
  padding-right: .75rem;
}
.content-block__more {
  font-family: var(--font-ui);
  font-size: .75rem;
  color: var(--accent);
  font-weight: 500;
  letter-spacing: .04em;
}
.content-block__more:hover { color: var(--accent-dark); }

/* Post Card */
.post-card { display: flex; flex-direction: column; }
.post-card__image {
  width: 100%;
  aspect-ratio: 16/9;
  object-fit: cover;
  border-radius: var(--r-md);
  margin-bottom: 1rem;
  transition: opacity var(--t);
}
.post-card__image:hover { opacity: .92; }
.post-card__date {
  font-family: var(--font-ui);
  font-size: .72rem;
  color: var(--text-muted);
  margin-bottom: .4rem;
}
.post-card__title {
  font-family: var(--font-heading);
  font-size: 1.15rem;
  font-weight: 600;
  line-height: 1.4;
  margin-bottom: .6rem;
}
.post-card__title a:hover { color: var(--accent); }
.post-card__excerpt {
  font-size: .9rem;
  color: var(--text-muted);
  line-height: 1.7;
  -webkit-line-clamp: 3;
  display: -webkit-box;
  -webkit-box-orient: vertical;
  overflow: hidden;
  margin-bottom: .8rem;
}
.read-more {
  font-family: var(--font-ui);
  font-size: .78rem;
  font-weight: 600;
  color: var(--accent);
  display: inline-flex;
  align-items: center;
  gap: .3rem;
  transition: gap var(--t);
}
.read-more:hover { color: var(--accent-dark); gap: .5rem; }

/* Sidebar Widgets */
.widget-block { border: 1px solid var(--border); border-radius: var(--r-md); overflow: hidden; }
.widget-block__img {
  width: 100%;
  aspect-ratio: 3/4;
  object-fit: cover;
}
.widget-block__body { padding: 1.25rem; }
.widget-block__label {
  font-family: var(--font-ui);
  font-size: .68rem;
  font-weight: 600;
  letter-spacing: .12em;
  text-transform: uppercase;
  color: var(--accent);
  margin-bottom: .5rem;
}
.widget-block__title {
  font-family: var(--font-heading);
  font-size: 1rem;
  font-weight: 600;
  line-height: 1.4;
  margin-bottom: .75rem;
}
.widget-block__cta {
  display: inline-block;
  font-family: var(--font-ui);
  font-size: .78rem;
  font-weight: 600;
  color: var(--accent);
  border: 1px solid var(--accent);
  border-radius: var(--r-sm);
  padding: .35rem .85rem;
  transition: background var(--t), color var(--t);
}
.widget-block__cta:hover {
  background: var(--accent);
  color: #fff;
}

/* Conference upcoming */
.upcoming-event {
  border: 1px solid var(--border);
  border-radius: var(--r-md);
  overflow: hidden;
}
.upcoming-event__img {
  width: 100%;
  aspect-ratio: 16/9;
  object-fit: cover;
}
.upcoming-event__body { padding: 1.25rem; }
.upcoming-event__date {
  font-family: var(--font-ui);
  font-size: .72rem;
  color: var(--text-muted);
  margin-bottom: .4rem;
}
.upcoming-event__title {
  font-family: var(--font-heading);
  font-size: 1rem;
  font-weight: 600;
  line-height: 1.4;
  margin-bottom: .75rem;
}

/* ============================================================
   Media Logos Strip
============================================================ */
.media-strip {
  background: var(--surface);
  border-top: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
  padding-block: 2.5rem;
}
.media-strip__label {
  text-align: center;
  margin-bottom: 1.5rem;
}
.media-logos {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  gap: 1.5rem 2.5rem;
}
.media-logos img {
  max-height: 28px;
  width: auto;
  filter: grayscale(1);
  opacity: .55;
  transition: all var(--t);
}
.media-logos img:hover { filter: grayscale(0); opacity: 1; }

/* ============================================================
   Newsletter
============================================================ */
.newsletter-section {
  background: var(--surface-warm);
  padding-block: 4rem;
  text-align: center;
}
.newsletter-section h2 {
  font-size: 1.5rem;
  margin-bottom: .6rem;
}
.newsletter-section p {
  font-size: .9rem;
  color: var(--text-muted);
  margin-bottom: 1.5rem;
}
.newsletter-form {
  display: flex;
  justify-content: center;
  gap: .5rem;
  flex-wrap: wrap;
}
.newsletter-form input[type="email"] {
  padding: .65rem 1.1rem;
  border: 1px solid var(--border);
  border-radius: var(--r-sm);
  font-family: var(--font-body);
  font-size: .9rem;
  min-width: 260px;
  direction: rtl;
  outline: none;
  transition: border-color var(--t);
}
.newsletter-form input[type="email"]:focus { border-color: var(--accent); }
.btn-primary {
  padding: .65rem 1.4rem;
  background: var(--accent);
  color: #fff;
  border: none;
  border-radius: var(--r-sm);
  font-family: var(--font-ui);
  font-size: .85rem;
  font-weight: 600;
  transition: background var(--t);
}
.btn-primary:hover { background: var(--accent-dark); }

/* ============================================================
   Photo Gallery Strip
============================================================ */
.gallery-strip {
  padding-block: 3.5rem;
}
.gallery-strip__header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 1.5rem;
}
.gallery-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: .75rem;
}
.gallery-grid img {
  width: 100%;
  aspect-ratio: 4/3;
  object-fit: cover;
  border-radius: var(--r-sm);
  transition: opacity var(--t), transform var(--t);
}
.gallery-grid img:hover { opacity: .88; transform: scale(1.02); }

/* ============================================================
   Site Footer
============================================================ */
.site-footer {
  background: var(--text);
  color: rgba(255,255,255,.75);
  padding-block: 3rem 1.5rem;
}
.footer-inner {
  display: grid;
  grid-template-columns: 2fr 1fr 1fr;
  gap: 3rem;
  padding-bottom: 2rem;
  border-bottom: 1px solid rgba(255,255,255,.1);
  margin-bottom: 1.5rem;
}
.footer-brand .site-title { color: #fff; font-size: 1.2rem; }
.footer-brand p {
  font-size: .85rem;
  color: rgba(255,255,255,.55);
  margin-top: .75rem;
  line-height: 1.7;
}
.footer-col h4 {
  color: #fff;
  font-family: var(--font-ui);
  font-size: .78rem;
  font-weight: 600;
  letter-spacing: .1em;
  text-transform: uppercase;
  margin-bottom: 1rem;
}
.footer-col ul { display: flex; flex-direction: column; gap: .5rem; }
.footer-col ul a {
  font-family: var(--font-ui);
  font-size: .82rem;
  color: rgba(255,255,255,.6);
  transition: color var(--t);
}
.footer-col ul a:hover { color: var(--accent-light); }
.footer-bottom {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 1rem;
}
.footer-bottom p {
  font-family: var(--font-ui);
  font-size: .75rem;
  color: rgba(255,255,255,.4);
  margin: 0;
}
.footer-social {
  display: flex;
  gap: .6rem;
}
.footer-social a {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  border: 1px solid rgba(255,255,255,.15);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: .85rem;
  color: rgba(255,255,255,.5);
  transition: all var(--t);
}
.footer-social a:hover {
  border-color: var(--accent-light);
  color: var(--accent-light);
  background: rgba(139,105,20,.15);
}

/* ============================================================
   Inner Page Layout
============================================================ */
.page-header {
  background: var(--surface-warm);
  padding-block: 3rem;
  border-bottom: 1px solid var(--border);
  text-align: center;
}
.page-header h1 { font-size: clamp(1.8rem, 3vw, 2.5rem); margin-bottom: .5rem; }
.page-header .breadcrumb {
  font-family: var(--font-ui);
  font-size: .78rem;
  color: var(--text-muted);
}
.page-header .breadcrumb a:hover { color: var(--accent); }

.page-content-area {
  padding-block: 4rem;
}
.page-with-sidebar {
  display: grid;
  grid-template-columns: 1fr 300px;
  gap: 3rem;
  align-items: start;
}

/* Archive grid */
.archive-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 2.5rem;
}
.archive-card {
  border: 1px solid var(--border);
  border-radius: var(--r-md);
  overflow: hidden;
  transition: box-shadow var(--t), transform var(--t);
}
.archive-card:hover { box-shadow: var(--sh-md); transform: translateY(-2px); }
.archive-card__img {
  width: 100%;
  aspect-ratio: 16/9;
  object-fit: cover;
}
.archive-card__body { padding: 1.25rem; }
.archive-card__cat {
  font-family: var(--font-ui);
  font-size: .68rem;
  font-weight: 600;
  color: var(--accent);
  letter-spacing: .1em;
  text-transform: uppercase;
  margin-bottom: .4rem;
}
.archive-card__title {
  font-family: var(--font-heading);
  font-size: 1.05rem;
  font-weight: 600;
  line-height: 1.4;
  margin-bottom: .5rem;
}
.archive-card__excerpt {
  font-size: .85rem;
  color: var(--text-muted);
  line-height: 1.65;
  -webkit-line-clamp: 3;
  display: -webkit-box;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

/* Single post */
.single-post-header {
  background: var(--surface-warm);
  padding-block: 4rem;
  border-bottom: 1px solid var(--border);
}
.single-post-meta {
  font-family: var(--font-ui);
  font-size: .78rem;
  color: var(--text-muted);
  margin-bottom: 1rem;
}
.single-post-cat {
  font-family: var(--font-ui);
  font-size: .7rem;
  font-weight: 600;
  color: var(--accent);
  letter-spacing: .1em;
  text-transform: uppercase;
  margin-bottom: .5rem;
  display: block;
}
.single-post-title {
  font-size: clamp(1.8rem, 3vw, 2.5rem);
  line-height: 1.3;
  margin-bottom: 1rem;
}
.single-featured-img {
  width: 100%;
  max-height: 500px;
  object-fit: cover;
  border-radius: var(--r-md);
  margin-bottom: 2.5rem;
}
.entry-content {
  font-size: 1.05rem;
  line-height: 1.95;
}
.entry-content h2,
.entry-content h3 { margin: 2em 0 .8em; }
.entry-content p { margin-bottom: 1.4em; }
.entry-content blockquote {
  border-right: 3px solid var(--accent);
  padding: .75rem 1.25rem;
  background: var(--surface-warm);
  border-radius: 0 var(--r-sm) var(--r-sm) 0;
  margin: 1.5em 0;
  font-style: italic;
  color: var(--text-muted);
}
.entry-content a { color: var(--accent); text-decoration: underline; }

/* Sidebar */
.sidebar-widget {
  border: 1px solid var(--border);
  border-radius: var(--r-md);
  padding: 1.25rem;
  margin-bottom: 1.5rem;
}
.sidebar-widget__title {
  font-family: var(--font-heading);
  font-size: .95rem;
  font-weight: 700;
  padding-bottom: .75rem;
  border-bottom: 1px solid var(--border);
  margin-bottom: 1rem;
}
.recent-posts-list { display: flex; flex-direction: column; gap: 1rem; }
.recent-post-item { display: flex; gap: .75rem; align-items: flex-start; }
.recent-post-item img {
  width: 64px;
  height: 64px;
  object-fit: cover;
  border-radius: var(--r-sm);
  flex-shrink: 0;
}
.recent-post-item__text {}
.recent-post-item__title {
  font-family: var(--font-heading);
  font-size: .85rem;
  font-weight: 600;
  line-height: 1.4;
  margin-bottom: .2rem;
}
.recent-post-item__date {
  font-family: var(--font-ui);
  font-size: .7rem;
  color: var(--text-muted);
}

/* Pagination */
.pagination {
  display: flex;
  justify-content: center;
  gap: .4rem;
  margin-top: 3rem;
}
.page-numbers {
  font-family: var(--font-ui);
  font-size: .82rem;
  padding: .45rem .8rem;
  border: 1px solid var(--border);
  border-radius: var(--r-sm);
  color: var(--text);
  transition: all var(--t);
}
.page-numbers:hover,
.page-numbers.current {
  background: var(--accent);
  border-color: var(--accent);
  color: #fff;
}

/* Biography page */
.bio-layout {
  display: grid;
  grid-template-columns: 260px 1fr;
  gap: 4rem;
  align-items: start;
  padding-block: 4rem;
}
.bio-portrait {
  position: sticky;
  top: calc(var(--nav-h) + 2rem);
}
.bio-portrait img {
  width: 100%;
  border-radius: var(--r-lg);
  box-shadow: var(--sh-lg);
}
.bio-content h2 { font-size: 1.5rem; margin: 1.8em 0 .7em; }
.bio-content h3 { font-size: 1.2rem; margin: 1.5em 0 .6em; }
.bio-content p { margin-bottom: 1.3em; font-size: 1rem; line-height: 1.9; }

/* Books / Publications */
.books-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 2rem;
  padding-block: 3rem;
}
.book-card {
  border: 1px solid var(--border);
  border-radius: var(--r-md);
  overflow: hidden;
  transition: box-shadow var(--t);
}
.book-card:hover { box-shadow: var(--sh-md); }
.book-card__cover {
  width: 100%;
  aspect-ratio: 2/3;
  object-fit: cover;
}
.book-card__body { padding: 1.1rem; }
.book-card__title {
  font-family: var(--font-heading);
  font-size: 1rem;
  font-weight: 700;
  margin-bottom: .35rem;
}
.book-card__year {
  font-family: var(--font-ui);
  font-size: .72rem;
  color: var(--text-muted);
}

/* ============================================================
   Responsive
============================================================ */
@media (max-width: 1024px) {
  .hero-inner { grid-template-columns: 1fr 220px; gap: 2.5rem; }
  .homepage-grid .wrap { grid-template-columns: 1fr; }
  .footer-inner { grid-template-columns: 1fr 1fr; }
  .gallery-grid { grid-template-columns: repeat(3, 1fr); }
  .books-grid { grid-template-columns: repeat(2, 1fr); }
  .bio-layout { grid-template-columns: 200px 1fr; gap: 2.5rem; }
}

@media (max-width: 768px) {
  .primary-nav { display: none; }
  .primary-nav.is-open {
    display: block;
    position: fixed;
    inset: var(--nav-h) 0 0 0;
    background: var(--surface);
    overflow-y: auto;
    padding: 1rem;
    border-top: 1px solid var(--border);
    z-index: 199;
  }
  .primary-nav.is-open .nav-menu { flex-direction: column; align-items: flex-start; gap: 0; }
  .primary-nav.is-open .nav-menu > li { width: 100%; }
  .primary-nav.is-open .nav-menu > li > a { padding: .75rem .5rem; border-bottom: 1px solid var(--border-light); width: 100%; }
  .primary-nav.is-open .sub-menu {
    position: static;
    opacity: 1;
    visibility: visible;
    transform: none;
    box-shadow: none;
    border: none;
    background: var(--border-light);
    border-radius: 0;
    padding-right: 1rem;
  }
  .menu-toggle { display: block; }

  .hero-inner { grid-template-columns: 1fr; }
  .hero-portrait { max-width: 200px; margin-inline: auto; }
  .grid-2, .grid-3 { grid-template-columns: 1fr; }
  .footer-inner { grid-template-columns: 1fr; gap: 2rem; }
  .gallery-grid { grid-template-columns: repeat(2, 1fr); }
  .archive-grid { grid-template-columns: 1fr; }
  .books-grid { grid-template-columns: 1fr 1fr; }
  .bio-layout { grid-template-columns: 1fr; }
  .bio-portrait { position: static; max-width: 220px; margin-inline: auto; }
  .page-with-sidebar { grid-template-columns: 1fr; }
  .homepage-sidebar { order: -1; }
}

@media (max-width: 480px) {
  :root { --nav-h: 60px; }
  .books-grid { grid-template-columns: 1fr; }
  .gallery-grid { grid-template-columns: repeat(2, 1fr); }
  .newsletter-form { flex-direction: column; align-items: center; }
  .newsletter-form input[type="email"] { min-width: 100%; }
}

/* ============================================================
   Utilities
============================================================ */
.visually-hidden { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0,0,0,0); white-space: nowrap; }
.text-center { text-align: center; }
.mt-auto { margin-top: auto; }
