/* ============================================================
   Harper Botanical — Projects
   Shared styles for the Projects index + detail pages.
   Base header/footer mirror the main site (Open Sans, greens).
   ============================================================ */

:root {
    /* Sage-green accent palette */
    --green-dark: #47605a;
    --green: #5f8175;
    --green-tint: #d5e2dc;
    --green-tint-2: #ebf2ef;
    --ink: #333;
    --muted: #666;
    --line: #e3e3e3;
    --max: 1200px;
}

* { margin: 0; padding: 0; box-sizing: border-box; }

body {
    font-family: 'Open Sans', sans-serif;
    line-height: 1.6;
    color: var(--ink);
    background: #fff;
}

img { max-width: 100%; }
a { color: var(--green-dark); }

.container { max-width: var(--max); margin: 0 auto; padding: 0 20px; }

/* ── Header (mirrors main site) ── */
header {
    background-color: transparent;
    position: fixed;
    width: 100%;
    top: 0;
    z-index: 1000;
    padding: 20px 0;
    transition: all 0.3s ease;
}
header.scrolled {
    background-color: rgba(255, 255, 255, 0.95);
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
}
header.scrolled .logo,
header.scrolled nav a { color: #333; }

.header-inner {
    max-width: var(--max);
    margin: 0 auto;
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0 20px;
}
.logo {
    font-size: 32px;
    color: #fff;
    text-decoration: none;
    font-weight: bold;
    transition: color 0.3s ease;
}
nav ul { display: flex; list-style: none; gap: 30px; }
header nav ul li { font-size: 1.6em; }
nav a {
    color: #fff;
    text-decoration: none;
    font-size: 16px;
    transition: color 0.3s ease;
}
nav a:hover,
header.scrolled nav a:hover { color: #666; }
nav a.active { border-bottom: 2px solid currentColor; padding-bottom: 2px; }

.header-social { display: flex; gap: 15px; align-items: center; }
.social-icon {
    display: flex; align-items: center; justify-content: center;
    width: 24px; height: 24px; transition: opacity 0.3s ease;
}
.social-icon:hover { opacity: 0.7; }
.social-icon svg { width: 100%; height: 100%; fill: #fff; transition: fill 0.3s ease; }
header.scrolled .social-icon svg { fill: #333; }

/* Hamburger */
.hamburger { display: none; background: none; border: none; cursor: pointer; padding: 4px; }
.hamburger span {
    display: block; width: 22px; height: 2px; background: #fff; margin: 5px 0;
    transition: all 0.3s ease;
}
header.scrolled .hamburger span { background: #333; }
.hamburger.active span:nth-child(1) { transform: rotate(45deg) translate(5px, 5px); }
.hamburger.active span:nth-child(2) { opacity: 0; }
.hamburger.active span:nth-child(3) { transform: rotate(-45deg) translate(5px, -5px); }

header.menu-open {
    background-color: rgba(255, 255, 255, 0.97) !important;
    box-shadow: 0 1px 8px rgba(0, 0, 0, 0.08);
}
header.menu-open .logo,
header.menu-open nav a { color: #333; }
header.menu-open .hamburger span { background: #333; }
header.menu-open .social-icon svg { fill: #333; }

/* ── Page hero ── */
.page-hero {
    background: linear-gradient(135deg, var(--green-dark) 0%, var(--green) 100%);
    padding: 140px 20px 60px;
    text-align: center;
    color: #fff;
    position: relative;
    overflow: hidden;
}
.page-hero::after {
    content: '';
    position: absolute;
    inset: 0;
    background:
        radial-gradient(circle at 15% 20%, rgba(255,255,255,0.10), transparent 40%),
        radial-gradient(circle at 85% 80%, rgba(0,0,0,0.15), transparent 45%);
    pointer-events: none;
}
.page-hero h1 { font-size: 46px; font-weight: 700; margin-bottom: 12px; position: relative; }
.page-hero p { font-size: 18px; color: rgba(255,255,255,0.9); max-width: 700px; margin: 0 auto; position: relative; }

/* ── Leaf divider ── */
.leaf-divider {
    text-align: center;
    padding: 30px 0 10px;
    color: var(--green);
    font-size: 20px;
    letter-spacing: 12px;
    opacity: 0.4;
}

/* ── Projects index ── */
.projects-intro {
    max-width: 760px;
    margin: 10px auto 0;
    padding: 20px;
    text-align: center;
    color: var(--muted);
    font-size: 17px;
}
.projects-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 28px;
    max-width: var(--max);
    margin: 20px auto 40px;
    padding: 0 20px;
}
.project-card {
    background: #fff;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 2px 16px rgba(0,0,0,0.07);
    transition: box-shadow 0.3s, transform 0.3s;
    text-decoration: none;
    color: inherit;
    display: flex;
    flex-direction: column;
}
.project-card:hover { box-shadow: 0 10px 30px rgba(45,80,22,0.16); transform: translateY(-4px); }
.project-card .thumb {
    position: relative;
    aspect-ratio: 3 / 2;
    overflow: hidden;
    background: var(--green-tint-2);
}
.project-card .thumb img {
    width: 100%; height: 100%; object-fit: cover; display: block;
    transition: transform 0.5s ease;
}
.project-card:hover .thumb img { transform: scale(1.04); }
.project-card .card-body { padding: 20px; display: flex; flex-direction: column; flex: 1; }
.project-card h3 { font-size: 20px; color: var(--green-dark); margin-bottom: 4px; line-height: 1.3; }
.project-card .card-sub { font-size: 13px; color: var(--muted); margin-bottom: 12px; }
.project-card .card-teaser { font-size: 14px; color: #555; margin-bottom: 16px; flex: 1; }
.card-tags { display: flex; flex-wrap: wrap; gap: 6px; }
.card-tag {
    font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: 0.5px;
    color: var(--green); background: var(--green-tint-2);
    padding: 4px 10px; border-radius: 999px;
}

/* ── Detail page ── */
.breadcrumb {
    max-width: var(--max); margin: 0 auto; padding: 30px 20px 0;
    font-size: 14px; color: var(--muted);
}
.breadcrumb a { color: var(--green); text-decoration: none; }
.breadcrumb a:hover { text-decoration: underline; }

.project-detail { max-width: 960px; margin: 0 auto; padding: 20px; }
.project-title { font-size: 40px; color: var(--green-dark); line-height: 1.15; margin-bottom: 8px; }
.project-subtitle { font-size: 20px; color: var(--muted); font-weight: 400; margin-bottom: 24px; }

.facts {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    gap: 1px;
    background: var(--line);
    border: 1px solid var(--line);
    border-radius: 10px;
    overflow: hidden;
    margin: 24px 0 36px;
}
.fact { background: #fff; padding: 14px 16px; }
.fact .k { font-size: 11px; text-transform: uppercase; letter-spacing: 0.6px; color: var(--green); font-weight: 700; }
.fact .v { font-size: 15px; color: var(--ink); }

.project-detail h2 {
    font-size: 26px; color: var(--green-dark); margin: 40px 0 14px;
    padding-bottom: 8px; border-bottom: 2px solid var(--green-tint);
}
.project-detail h3 { font-size: 19px; color: var(--green); margin: 24px 0 10px; }
.project-detail p { margin-bottom: 16px; font-size: 16.5px; }
.project-detail .lead { font-size: 19px; color: #444; }

.pullquote {
    border-left: 4px solid var(--green);
    background: var(--green-tint-2);
    padding: 18px 22px;
    margin: 24px 0;
    font-style: italic;
    font-size: 18px;
    color: #3a4a2c;
    border-radius: 0 8px 8px 0;
}

.feature-list { list-style: none; margin: 8px 0 20px; }
.feature-list li { position: relative; padding-left: 26px; margin-bottom: 10px; font-size: 16px; }
.feature-list li::before {
    content: '❧'; position: absolute; left: 0; top: 0; color: var(--green); font-size: 15px;
}

/* Plant palette chips */
.palette { display: flex; flex-wrap: wrap; gap: 8px; margin: 10px 0 24px; }
.plant-chip {
    background: var(--green-tint-2);
    border: 1px solid var(--green-tint);
    border-radius: 999px;
    padding: 6px 14px;
    font-size: 14px;
    color: #3a4a2c;
}
.plant-chip .latin { font-style: italic; color: var(--muted); font-size: 12.5px; }

/* Poster figures */
.poster {
    margin: 18px 0 28px;
    border: 1px solid var(--line);
    border-radius: 10px;
    overflow: hidden;
    cursor: zoom-in;
    box-shadow: 0 2px 14px rgba(0,0,0,0.06);
    background: #fafafa;
}
.poster img { width: 100%; display: block; }
.poster figcaption,
.gallery figcaption {
    font-size: 13px; color: var(--muted); padding: 10px 14px; background: #fff;
}

/* Gallery */
.gallery {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
    gap: 14px;
    margin: 16px 0 28px;
}
.gallery figure {
    border: 1px solid var(--line);
    border-radius: 8px;
    overflow: hidden;
    cursor: zoom-in;
    background: #fff;
    transition: box-shadow 0.25s, transform 0.25s;
}
.gallery figure:hover { box-shadow: 0 8px 20px rgba(0,0,0,0.10); transform: translateY(-2px); }
.gallery img { width: 100%; aspect-ratio: 16/10; object-fit: cover; display: block; }

/* ── Species table ── */
.species-tools {
    display: flex; flex-wrap: wrap; gap: 12px; align-items: center;
    margin: 8px 0 14px;
}
.species-tools input {
    flex: 1; min-width: 200px;
    padding: 10px 14px; font-size: 15px; font-family: inherit;
    border: 1px solid var(--line); border-radius: 8px;
}
.species-tools input:focus { outline: none; border-color: var(--green); }
.species-tools .count { font-size: 13px; color: var(--muted); }

.table-wrap { overflow-x: auto; border: 1px solid var(--line); border-radius: 10px; }
table.species {
    width: 100%; border-collapse: collapse; font-size: 14px; min-width: 760px;
}
table.species thead th {
    background: var(--green-dark); color: #fff; text-align: left;
    padding: 12px 14px; font-size: 13px; position: sticky; top: 0;
    cursor: pointer; white-space: nowrap; user-select: none;
}
table.species thead th:hover { background: #587369; }
table.species thead th .arrow { opacity: 0.5; font-size: 11px; margin-left: 4px; }
table.species tbody td { padding: 11px 14px; border-top: 1px solid var(--line); vertical-align: top; }
table.species tbody tr:nth-child(even) { background: var(--green-tint-2); }
table.species tbody tr:hover { background: var(--green-tint); }
table.species .sci { font-style: italic; font-weight: 600; color: var(--green-dark); }
table.species .eco strong { color: var(--green-dark); }
.species-empty { padding: 20px; text-align: center; color: var(--muted); display: none; }

/* Back link */
.back-link { display: inline-block; margin: 20px 0 10px; color: var(--green); text-decoration: none; font-weight: 600; }
.back-link:hover { text-decoration: underline; }

.btn {
    display: inline-block; padding: 12px 30px;
    background-color: var(--green-dark); color: #fff; text-decoration: none;
    border-radius: 5px; font-weight: bold; transition: background-color 0.3s;
}
.btn:hover { background-color: var(--green); }

/* ── Footer (mirrors main site) ── */
.site-footer {
    background-color: #333; color: #fff; padding: 40px 0; text-align: center; margin-top: 60px;
}
.footer-content { display: flex; flex-direction: column; align-items: center; gap: 20px; }
.footer-social { display: flex; gap: 20px; }
.footer-social a { color: #fff; text-decoration: none; transition: opacity 0.3s ease; }
.footer-social a:hover { opacity: 0.8; }

/* ── Lightbox ── */
.lightbox {
    position: fixed; inset: 0; z-index: 2000;
    background: rgba(20, 25, 15, 0.92);
    display: none; align-items: center; justify-content: center;
    padding: 30px;
}
.lightbox.open { display: flex; }
.lightbox img {
    max-width: 96vw; max-height: 92vh; object-fit: contain;
    border-radius: 4px; box-shadow: 0 10px 40px rgba(0,0,0,0.5);
}
.lightbox .lb-close,
.lightbox .lb-nav {
    position: absolute; background: rgba(255,255,255,0.14); color: #fff;
    border: none; cursor: pointer; border-radius: 50%;
    width: 48px; height: 48px; font-size: 24px; line-height: 1;
    display: flex; align-items: center; justify-content: center;
    transition: background 0.2s;
}
.lightbox .lb-close:hover,
.lightbox .lb-nav:hover { background: rgba(255,255,255,0.28); }
.lightbox .lb-close { top: 20px; right: 24px; }
.lightbox .lb-prev { left: 24px; top: 50%; transform: translateY(-50%); }
.lightbox .lb-next { right: 24px; top: 50%; transform: translateY(-50%); }
.lightbox .lb-caption {
    position: absolute; bottom: 18px; left: 0; right: 0; text-align: center;
    color: rgba(255,255,255,0.85); font-size: 14px; padding: 0 20px;
}

/* ── Responsive ── */
@media (max-width: 900px) {
    .projects-grid { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 768px) {
    .hamburger { display: block; }
    .header-inner { flex-wrap: wrap; padding: 0 15px; }
    nav { display: none; width: 100%; padding: 10px 0; }
    nav.open { display: block; }
    nav ul { flex-direction: column; gap: 0; }
    nav ul li { font-size: 1em; }
    nav a { display: block; padding: 10px 0; font-size: 15px; }
    nav a.active { border: none; }
    .header-social { display: none; }
    nav.open ~ .header-social { display: flex; width: 100%; justify-content: center; padding-bottom: 10px; }

    .page-hero { padding: 130px 20px 50px; }
    .page-hero h1 { font-size: 34px; }
    .projects-grid { grid-template-columns: 1fr; }
    .project-title { font-size: 30px; }
    .lightbox .lb-nav { width: 40px; height: 40px; }
}
