/*
Theme Name: Robert Lord Writers Cottage
Theme URI: http://rlc.arts.nz/
Description: Official theme for the Robert Lord Writers Cottage Trust — Dunedin, New Zealand.
Author: Robert Lord Writers Cottage Trust
Version: 2.0
*/

:root {
  --white:      #ffffff;
  --black:      #0d0d0d;
  --gray-50:    #f9f9f9;
  --gray-100:   #f2f2f2;
  --gray-200:   #e5e5e5;
  --gray-400:   #aaaaaa;
  --gray-600:   #666666;
  --gray-800:   #333333;
  --green:      #1b5e45;
  --green-dark: #134535;
  --green-tint: #edf5f1;
  --text:       #0d0d0d;
  --text-sub:   #555555;
  --border:     #e5e5e5;
  --radius:     3px;
}

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }
body {
  font-family: 'DM Sans', system-ui, -apple-system, sans-serif;
  font-size: 17px;
  line-height: 1.7;
  color: var(--text);
  background: var(--white);
  -webkit-font-smoothing: antialiased;
}
img { display: block; max-width: 100%; height: auto; }
a { color: var(--green); text-decoration: none; }
a:hover { text-decoration: underline; text-underline-offset: 3px; }
p + p { margin-top: 1em; }
strong { font-weight: 600; }

h1, h2, h3, h4 { font-family: 'Fraunces', Georgia, serif; line-height: 1.15; color: var(--text); font-weight: 600; }

.eyebrow { display: block; font-family: 'DM Sans', sans-serif; font-size: 0.72rem; font-weight: 600; letter-spacing: 0.14em; text-transform: uppercase; color: var(--green); margin-bottom: 0.75rem; }
.display-title { font-family: 'Fraunces', Georgia, serif; font-size: clamp(2.8rem, 6vw, 5rem); font-weight: 600; line-height: 1.05; letter-spacing: -0.02em; }
.display-title em { font-style: italic; color: var(--green); }
.page-title { font-family: 'Fraunces', Georgia, serif; font-size: clamp(2rem, 4vw, 3rem); font-weight: 600; letter-spacing: -0.015em; line-height: 1.1; }
.page-title em { font-style: italic; color: var(--green); }
.section-heading { font-family: 'Fraunces', Georgia, serif; font-size: clamp(1.5rem, 3vw, 2rem); font-weight: 600; letter-spacing: -0.01em; margin-bottom: 1rem; }
.section-heading em { font-style: italic; color: var(--green); }
.lead { font-size: 1.08rem; color: var(--text-sub); line-height: 1.75; max-width: 600px; }

.wrap    { max-width: 1160px; margin: 0 auto; padding: 0 2rem; }
.wrap--sm { max-width: 760px; margin: 0 auto; padding: 0 2rem; }
.wrap--md { max-width: 960px; margin: 0 auto; padding: 0 2rem; }

.section { padding: 5.5rem 0; }
.section--sm { padding: 3.5rem 0; }
.section--gray { background: var(--gray-50); }
.section--border { border-top: 1px solid var(--border); }

.divider { border: none; border-top: 1px solid var(--border); margin: 2.5rem 0; }

/* NAV */
.site-header { position: sticky; top: 0; z-index: 100; background: var(--white); border-bottom: 1px solid var(--border); }
.nav-wrap { display: flex; align-items: center; justify-content: space-between; height: 60px; max-width: 1160px; margin: 0 auto; padding: 0 2rem; }
.site-logo { font-family: 'Fraunces', Georgia, serif; font-size: 0.98rem; font-weight: 600; color: var(--text); letter-spacing: -0.01em; line-height: 1.2; flex-shrink: 0; text-decoration: none; }
.site-logo:hover { text-decoration: none; }
.site-logo span { display: block; font-family: 'DM Sans', sans-serif; font-size: 0.67rem; font-weight: 400; letter-spacing: 0.03em; color: var(--gray-600); }
.nav-menu { display: flex; list-style: none; align-items: center; gap: 0.15rem; }
.nav-menu li a { display: block; padding: 0.4rem 0.7rem; font-size: 0.83rem; font-weight: 500; color: var(--gray-800); border-radius: var(--radius); transition: background 0.15s, color 0.15s; }
.nav-menu li a:hover, .nav-menu li.current-menu-item a { background: var(--gray-100); color: var(--black); text-decoration: none; }
.nav-menu .nav-apply a { background: var(--green); color: var(--white); margin-left: 0.5rem; }
.nav-menu .nav-apply a:hover { background: var(--green-dark); color: var(--white); }
.nav-menu .nav-donate a { background: var(--black); color: var(--white); margin-left: 0.25rem; }
.nav-menu .nav-donate a:hover { background: var(--gray-800); color: var(--white); }
.nav-toggle { display: none; flex-direction: column; gap: 5px; background: none; border: none; cursor: pointer; padding: 6px; }
.nav-toggle span { display: block; width: 22px; height: 1.5px; background: var(--text); transition: 0.25s; }

/* BUTTONS */
.btn { display: inline-block; padding: 0.65em 1.5em; font-family: 'DM Sans', sans-serif; font-size: 0.88rem; font-weight: 500; border-radius: var(--radius); cursor: pointer; transition: background 0.15s, color 0.15s, border-color 0.15s; border: 1.5px solid transparent; text-decoration: none; letter-spacing: 0.01em; }
.btn:hover { text-decoration: none; }
.btn-black { background: var(--black); color: var(--white); border-color: var(--black); }
.btn-black:hover { background: var(--gray-800); border-color: var(--gray-800); color: var(--white); }
.btn-green { background: var(--green); color: var(--white); border-color: var(--green); }
.btn-green:hover { background: var(--green-dark); border-color: var(--green-dark); color: var(--white); }
.btn-outline { background: transparent; color: var(--text); border-color: var(--gray-200); }
.btn-outline:hover { border-color: var(--text); color: var(--text); }
.btn-outline-white { background: transparent; color: var(--white); border-color: rgba(255,255,255,0.4); }
.btn-outline-white:hover { border-color: var(--white); color: var(--white); }
.btn-lg { padding: 0.8em 2em; font-size: 0.97rem; }
.btn-sm { padding: 0.45em 1em; font-size: 0.8rem; }

/* HERO */
.hero { padding: 5.5rem 0 5rem; border-bottom: 1px solid var(--border); }
.hero-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 5rem; align-items: center; }
.hero-ctas { display: flex; gap: 0.75rem; margin-top: 2.5rem; flex-wrap: wrap; }
.hero-desc { margin-top: 1.25rem; color: var(--text-sub); max-width: 480px; font-size: 1.05rem; }
.hero-images { display: grid; grid-template-columns: 1fr 1fr; gap: 0.6rem; }
.hero-images img { width: 100%; border-radius: 4px; object-fit: cover; }
.hero-images img:first-child { grid-column: 1 / -1; aspect-ratio: 16/9; }
.hero-images img:not(:first-child) { aspect-ratio: 4/3; }

/* STATS */
.stats-bar { border-top: 1px solid var(--border); border-bottom: 1px solid var(--border); padding: 0; }
.stats-bar-inner { display: grid; grid-template-columns: repeat(3, 1fr); }
.stat-item { text-align: center; padding: 2.5rem 2rem; border-right: 1px solid var(--border); }
.stat-item:last-child { border-right: none; }
.stat-number { font-family: 'Fraunces', Georgia, serif; font-size: 3rem; font-weight: 600; color: var(--green); line-height: 1; letter-spacing: -0.02em; }
.stat-label { font-size: 0.83rem; color: var(--gray-600); margin-top: 0.3rem; }

/* CARDS */
.card-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 1rem; }
.card-grid--3 { grid-template-columns: repeat(3, 1fr); }
.card { background: var(--white); border: 1px solid var(--border); border-radius: 4px; padding: 1.75rem; transition: border-color 0.2s; }
.card:hover { border-color: var(--gray-400); }
.card h3 { font-family: 'Fraunces', Georgia, serif; font-size: 1.05rem; font-weight: 600; margin-bottom: 0.5rem; }
.card p { font-size: 0.9rem; color: var(--text-sub); line-height: 1.65; }
.card .card-amount { display: inline-block; font-size: 0.75rem; font-weight: 600; background: var(--green-tint); color: var(--green); padding: 0.2em 0.75em; border-radius: 20px; margin-top: 0.75rem; }

/* PAGE HEADER */
.page-header { padding: 4rem 0 3.5rem; border-bottom: 1px solid var(--border); }
.page-header .lead { margin-top: 1rem; }

/* POST CARD */
.post-card { border: 1px solid var(--border); border-radius: 4px; overflow: hidden; background: var(--white); transition: border-color 0.2s; margin-bottom: 1.25rem; }
.post-card:hover { border-color: var(--gray-400); }
.post-card-img img { width: 100%; height: 200px; object-fit: cover; display: block; }
.post-card-body { padding: 1.75rem; }
.post-meta { font-size: 0.75rem; color: var(--gray-600); text-transform: uppercase; letter-spacing: 0.08em; margin-bottom: 0.5rem; }
.post-card h2 { font-size: 1.2rem; margin-bottom: 0.65rem; line-height: 1.3; }
.post-card h2 a { color: var(--text); }
.post-card h2 a:hover { color: var(--green); text-decoration: none; }
.post-card p { font-size: 0.9rem; color: var(--text-sub); margin-bottom: 1.2rem; }

/* BLOG LAYOUT */
.blog-layout { display: grid; grid-template-columns: 1fr 260px; gap: 4rem; align-items: start; }
.sidebar-block { margin-bottom: 2.5rem; }
.sidebar-block h3 { font-family: 'DM Sans', sans-serif; font-size: 0.7rem; font-weight: 600; text-transform: uppercase; letter-spacing: 0.1em; color: var(--gray-600); margin-bottom: 0.9rem; padding-bottom: 0.6rem; border-bottom: 1px solid var(--border); }
.sidebar-link-list { list-style: none; }
.sidebar-link-list li { border-bottom: 1px solid var(--border); }
.sidebar-link-list li a { display: block; padding: 0.55rem 0; font-size: 0.87rem; color: var(--gray-800); }
.sidebar-link-list li a:hover { color: var(--green); text-decoration: none; }

/* SINGLE POST */
.single-layout { display: grid; grid-template-columns: 1fr 260px; gap: 4rem; align-items: start; }
.post-content { max-width: 680px; }
.post-content p { margin-bottom: 1.2em; line-height: 1.8; }
.post-content h2 { font-size: 1.4rem; margin: 2.5rem 0 0.9rem; }
.post-content img { margin: 2rem 0; border-radius: 4px; }
.post-content a { color: var(--green); text-decoration: underline; text-underline-offset: 2px; }
.post-header { margin-bottom: 2.5rem; }
.post-header h1 { font-size: clamp(1.6rem, 3vw, 2.4rem); line-height: 1.2; }
.post-date { font-size: 0.78rem; color: var(--gray-600); text-transform: uppercase; letter-spacing: 0.08em; margin-top: 0.6rem; }
.post-tags { margin-top: 2.5rem; padding-top: 1.5rem; border-top: 1px solid var(--border); }
.post-tags a { display: inline-block; background: var(--gray-100); color: var(--gray-800); font-size: 0.78rem; padding: 0.25em 0.75em; border-radius: 20px; margin-right: 0.4rem; margin-bottom: 0.4rem; }
.post-nav { display: flex; justify-content: space-between; gap: 2rem; margin-top: 3rem; padding-top: 2rem; border-top: 1px solid var(--border); font-size: 0.88rem; }

/* WRITERS */
.decade-heading { font-family: 'DM Sans', sans-serif; font-size: 0.7rem; font-weight: 600; text-transform: uppercase; letter-spacing: 0.12em; color: var(--green); padding-bottom: 0.6rem; border-bottom: 1px solid var(--border); margin-bottom: 0.75rem; }
.writers-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); list-style: none; margin-bottom: 3rem; }
.writers-grid li { display: flex; justify-content: space-between; align-items: baseline; padding: 0.4rem 0.5rem; border-bottom: 1px solid var(--gray-100); font-size: 0.88rem; transition: background 0.1s; }
.writers-grid li:hover { background: var(--gray-50); }
.writers-grid .year { font-size: 0.75rem; color: var(--gray-400); white-space: nowrap; }

/* FORM */
.form-wrap { background: var(--white); border: 1px solid var(--border); border-radius: 4px; padding: 2.5rem; }
.form-group { margin-bottom: 1.2rem; }
.form-label { display: block; font-size: 0.78rem; font-weight: 600; color: var(--text); margin-bottom: 0.4rem; letter-spacing: 0.02em; }
.form-label .req { color: var(--green); }
.form-control { width: 100%; padding: 0.6em 0.8em; border: 1.5px solid var(--gray-200); border-radius: var(--radius); background: var(--white); font-family: 'DM Sans', sans-serif; font-size: 0.93rem; color: var(--text); outline: none; transition: border-color 0.15s; appearance: none; }
.form-control:focus { border-color: var(--green); }
textarea.form-control { resize: vertical; min-height: 100px; }
select.form-control { background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='10' height='6'%3E%3Cpath d='M0 0l5 6 5-6z' fill='%23999'/%3E%3C/svg%3E"); background-repeat: no-repeat; background-position: right 0.8em center; cursor: pointer; }
.form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 1rem; }
.form-section-label { font-size: 0.7rem; font-weight: 600; text-transform: uppercase; letter-spacing: 0.1em; color: var(--gray-600); padding-bottom: 0.5rem; border-bottom: 1px solid var(--border); margin: 1.75rem 0 1.2rem; display: block; }
.form-check { display: flex; align-items: flex-start; gap: 0.6rem; margin-bottom: 0.9rem; }
.form-check input[type=checkbox] { width: 15px; height: 15px; flex-shrink: 0; margin-top: 3px; accent-color: var(--green); }
.form-check label { font-size: 0.87rem; color: var(--text-sub); line-height: 1.55; cursor: pointer; }
.form-check label .req { color: var(--green); }
.form-submit { width: 100%; padding: 0.85em; background: var(--green); color: var(--white); border: none; border-radius: var(--radius); font-family: 'DM Sans', sans-serif; font-size: 0.95rem; font-weight: 500; cursor: pointer; transition: background 0.15s; }
.form-submit:hover { background: var(--green-dark); }
.form-note { text-align: center; font-size: 0.78rem; color: var(--gray-600); margin-top: 0.75rem; }
.form-success { display: none; text-align: center; padding: 3rem 1rem; }
.form-success h3 { font-size: 1.4rem; color: var(--green); margin-bottom: 0.5rem; }
.form-success p { font-size: 0.9rem; color: var(--text-sub); }

/* INFO BOX */
.info-box { background: var(--green-tint); border: 1px solid #c2ddd4; border-radius: 4px; padding: 1.4rem; margin-bottom: 1.75rem; font-size: 0.9rem; }
.info-box h3 { font-family: 'DM Sans', sans-serif; font-size: 0.7rem; font-weight: 600; text-transform: uppercase; letter-spacing: 0.1em; color: var(--green); margin-bottom: 0.5rem; }
.info-box p { color: var(--gray-800); margin: 0; }
.info-box p + p { margin-top: 0.3rem; }
.req-list { list-style: none; margin: 0; }
.req-list li { padding: 0.5rem 0; border-bottom: 1px solid var(--border); font-size: 0.9rem; color: var(--text-sub); padding-left: 1.2rem; position: relative; }
.req-list li::before { content: '→'; position: absolute; left: 0; color: var(--green); font-size: 0.8rem; }

/* CTA BAND */
.cta-band { background: var(--green); border-radius: 4px; padding: 3rem; display: flex; justify-content: space-between; align-items: center; gap: 2rem; flex-wrap: wrap; }
.cta-band h2 { font-size: 1.6rem; color: var(--white); margin-bottom: 0.35rem; }
.cta-band p { color: rgba(255,255,255,0.8); font-size: 0.95rem; max-width: 520px; }
.cta-band-actions { display: flex; gap: 0.75rem; flex-shrink: 0; flex-wrap: wrap; align-items: center; }

/* LINK CARDS */
.link-card { display: block; border: 1px solid var(--border); border-radius: 4px; padding: 1.4rem; transition: border-color 0.2s; text-decoration: none; color: var(--text); position: relative; }
.link-card:hover { border-color: var(--gray-400); text-decoration: none; }
.link-card h3 { font-family: 'Fraunces', Georgia, serif; font-size: 1rem; font-weight: 600; color: var(--green); margin-bottom: 0.3rem; padding-right: 1.5rem; }
.link-card p { font-size: 0.84rem; color: var(--text-sub); margin: 0; line-height: 1.55; }
.link-card::after { content: '↗'; position: absolute; top: 1.2rem; right: 1.2rem; color: var(--gray-400); font-size: 0.85rem; transition: color 0.2s; }
.link-card:hover::after { color: var(--green); }

/* COTTAGE */
.two-col { display: grid; grid-template-columns: 1fr 1fr; gap: 5rem; align-items: start; }
.photo-stack { display: grid; gap: 0.5rem; }
.photo-stack img { width: 100%; border-radius: 4px; object-fit: cover; }
.photo-stack img:first-child { aspect-ratio: 4/3; }
.photo-stack img:last-child { aspect-ratio: 16/7; }
.photo-credit { font-size: 0.73rem; color: var(--gray-400); margin-top: 0.35rem; }
.fact-list { list-style: none; margin: 2rem 0; }
.fact-list li { display: flex; gap: 1rem; padding: 1rem 0; border-bottom: 1px solid var(--border); font-size: 0.93rem; }
.fact-icon { width: 26px; height: 26px; background: var(--green-tint); border-radius: 50%; display: flex; align-items: center; justify-content: center; flex-shrink: 0; margin-top: 1px; }
.fact-icon svg { width: 12px; height: 12px; fill: var(--green); }
.fact-list li div { color: var(--text-sub); }
.fact-list li div strong { color: var(--text); }

/* ROBERT LORD */
.portrait-aside { position: sticky; top: 80px; }
.portrait-aside img { width: 100%; border-radius: 4px; border: 1px solid var(--border); }
blockquote.pull-quote { border-left: 3px solid var(--green); padding: 1.2rem 1.75rem; margin: 2rem 0; background: var(--green-tint); border-radius: 0 4px 4px 0; font-family: 'Fraunces', Georgia, serif; font-size: 1.1rem; font-style: italic; color: var(--text); line-height: 1.65; }
.link-list { list-style: none; }
.link-list li a { display: block; padding: 0.65rem 0; border-bottom: 1px solid var(--border); font-size: 0.9rem; color: var(--gray-800); }
.link-list li a:hover { color: var(--green); text-decoration: none; }

/* FOOTER */
.site-footer { background: var(--black); color: rgba(255,255,255,0.5); padding: 4rem 0 2.5rem; }
.footer-grid { display: grid; grid-template-columns: 1.6fr 1fr 1fr; gap: 3rem; padding-bottom: 3rem; border-bottom: 1px solid rgba(255,255,255,0.08); margin-bottom: 2rem; }
.footer-brand h3 { font-family: 'Fraunces', Georgia, serif; font-size: 1.1rem; color: var(--white); margin-bottom: 0.6rem; font-weight: 600; }
.footer-brand p { font-size: 0.87rem; line-height: 1.75; }
.footer-brand a { color: rgba(255,255,255,0.65); }
.footer-brand a:hover { color: var(--white); text-decoration: none; }
.footer-col h4 { font-family: 'DM Sans', sans-serif; font-size: 0.68rem; font-weight: 600; text-transform: uppercase; letter-spacing: 0.12em; color: rgba(255,255,255,0.35); margin-bottom: 1rem; }
.footer-col ul { list-style: none; }
.footer-col ul li { margin-bottom: 0.4rem; }
.footer-col ul li a { font-size: 0.87rem; color: rgba(255,255,255,0.55); }
.footer-col ul li a:hover { color: var(--white); text-decoration: none; }
.footer-bottom { display: flex; justify-content: space-between; flex-wrap: wrap; gap: 0.5rem; font-size: 0.77rem; color: rgba(255,255,255,0.3); }

/* RESPONSIVE */
@media (max-width: 960px) {
  .hero-grid, .two-col { grid-template-columns: 1fr; gap: 3rem; }
  .hero-images { display: none; }
  .blog-layout, .single-layout { grid-template-columns: 1fr; gap: 3rem; }
  .portrait-aside { position: static; }
  .card-grid--3 { grid-template-columns: 1fr 1fr; }
  .footer-grid { grid-template-columns: 1fr 1fr; }
}

@media (max-width: 640px) {
  .wrap, .wrap--sm, .wrap--md { padding: 0 1.25rem; }
  .section { padding: 3.5rem 0; }
  .hero { padding: 3rem 0; }
  .page-header { padding: 2.5rem 0 2rem; }
  .nav-menu { display: none; flex-direction: column; position: absolute; top: 60px; left: 0; right: 0; background: var(--white); border-bottom: 1px solid var(--border); gap: 0; padding: 0.5rem 0; }
  .nav-menu.open { display: flex; }
  .nav-menu li { width: 100%; }
  .nav-menu li a { border-radius: 0; padding: 0.75rem 1.5rem; margin: 0; }
  .nav-menu .nav-apply a, .nav-menu .nav-donate a { border-radius: 0; margin: 0; }
  .nav-toggle { display: flex; }
  .site-header { position: relative; }
  .form-row { grid-template-columns: 1fr; }
  .form-wrap { padding: 1.5rem; }
  .cta-band { flex-direction: column; padding: 2rem; }
  .stats-bar-inner { grid-template-columns: 1fr; }
  .stat-item { border-right: none; border-bottom: 1px solid var(--border); }
  .stat-item:last-child { border-bottom: none; }
  .card-grid--3 { grid-template-columns: 1fr; }
  .footer-grid { grid-template-columns: 1fr; gap: 2rem; }
  .footer-bottom { flex-direction: column; }
}

.reveal { opacity: 0; transform: translateY(14px); transition: opacity 0.55s ease, transform 0.55s ease; }
.reveal.visible { opacity: 1; transform: none; }
