/* ============================================================
   VUNU website
   ============================================================ */

/* ---------- Design tokens ---------- */
:root {
    --color-green: #265d07;        /* primary green (header) */
    --color-green-dark: #132f03;   /* dark green (hover, footer) */
    --color-green-tint: #eef4e9;   /* light green hover background */
    --color-ink: #303a34;          /* headings */
    --color-text: #70767b;         /* body text */
    --color-muted: #a0a6ab;        /* dates, secondary labels */
    --color-line: #e6e9ec;         /* hairlines */
    --color-nav-link: #dddddd;     /* nav links on green */
    --color-surface: #ffffff;      /* cards, page background */

    --shadow-card: 0 1px 1px rgba(0, 0, 0, .1),
                   0 2px 2px rgba(0, 0, 0, .1),
                   0 4px 4px rgba(0, 0, 0, .1),
                   0 8px 8px rgba(0, 0, 0, .1);
    --shadow-card-hover: 0 4px 8px rgba(0, 0, 0, .15),
                         0 12px 24px rgba(0, 0, 0, .15);

    --radius-card: 10px;
    --radius-img: 4px;

    --container-max: 1280px;
    --content-max: 900px;

    --font-sans: 'Open Sans', 'Segoe UI', system-ui, -apple-system,
                 Roboto, Helvetica, Arial, sans-serif;
}

/* ---------- Reset & base ---------- */
*,
*::before,
*::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

html {
    scroll-behavior: smooth;
}

body {
    font-family: var(--font-sans);
    font-size: 1rem;
    line-height: 1.6;
    color: var(--color-text);
    background-color: var(--color-surface);
    display: flex;
    flex-direction: column;
    min-height: 100vh;
    overflow-x: hidden;
}

body > .site-header,
body > .site-main,
body > .site-footer {
    width: 100%;
}

img {
    display: block;
    max-width: 100%;
    height: auto;
}

a {
    color: var(--color-green);
    text-decoration: none;
}

a:hover {
    text-decoration: underline;
}

ul {
    list-style: none;
}

h1, h2, h3 {
    color: var(--color-ink);
    line-height: 1.25;
    font-weight: 600;
}

/* ---------- Layout container ---------- */
.container {
    width: 100%;
    max-width: var(--container-max);
    margin: 0 auto;
    padding-left: clamp(1rem, 4vw, 2rem);
    padding-right: clamp(1rem, 4vw, 2rem);
}

/* ---------- Header ---------- */
.site-header {
    position: sticky;
    top: 0;
    z-index: 100;
    background-color: var(--color-green);
    box-shadow: 0 2px 6px rgba(0, 0, 0, .25);
}

.header-inner {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    padding-top: .75rem;
    padding-bottom: .75rem;
}

/* Brand: logo + name */
.brand {
    display: flex;
    align-items: center;
    gap: .75rem;
    color: #ffffff;
    min-width: 0;
}

.brand:hover {
    text-decoration: none;
}

.brand-logo {
    height: 130px;
    width: auto;
    flex-shrink: 0;
}

.brand-text {
    display: flex;
    flex-direction: column;
    line-height: 1.2;
    min-width: 0;
    max-width: 260px;
}

.brand-name {
    font-size: 1.5rem;
    font-weight: 700;
    letter-spacing: .05em;
    color: #ffffff;
}

.brand-fullname {
    font-size: .9rem;
    font-weight: 400;
    line-height: 1.35;
    color: var(--color-nav-link);
}

/* Desktop navigation */
.site-nav ul {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
}

.site-nav a {
    display: block;
    padding: .55rem .7rem;
    color: var(--color-nav-link);
    font-size: .95rem;
    border-radius: 4px;
    transition: background-color .2s ease, color .2s ease;
}

.site-nav a:hover {
    color: #ffffff;
    background-color: var(--color-green-dark);
    text-decoration: none;
}

.site-nav a[aria-current="page"] {
    color: #ffffff;
    background-color: var(--color-green-dark);
}

/* ---------- Mobile navigation ---------- */
.nav-toggle {
    position: absolute;
    opacity: 0;
    pointer-events: none;
}

.nav-toggle-label {
    display: none;
    flex-direction: column;
    justify-content: center;
    gap: 5px;
    width: 44px;
    height: 44px;
    padding: 10px;
    cursor: pointer;
}

.nav-toggle-label span {
    display: block;
    height: 3px;
    width: 100%;
    border-radius: 2px;
    background-color: #ffffff;
}

@media (max-width: 767px) {
    .nav-toggle-label {
        display: flex;
        order: 3;
    }

    .brand {
        order: 1;
        flex: 1;
    }

    .brand-logo {
        height: clamp(72px, 20vw, 96px);
    }

    .site-nav {
        position: absolute;
        top: 100%;
        left: 0;
        right: 0;
        display: none;
        background-color: var(--color-green);
        box-shadow: 0 8px 16px rgba(0, 0, 0, .3);
    }

    .nav-toggle:checked ~ .site-nav {
        display: block;
    }

    .nav-toggle:checked ~ .nav-toggle-label span:nth-child(1) {
        transform: translateY(8px) rotate(45deg);
    }
    .nav-toggle:checked ~ .nav-toggle-label span:nth-child(2) {
        opacity: 0;
    }
    .nav-toggle:checked ~ .nav-toggle-label span:nth-child(3) {
        transform: translateY(-8px) rotate(-45deg);
    }

    .site-nav ul {
        flex-direction: column;
        align-items: stretch;
        padding: .5rem 0;
    }

    .site-nav a {
        padding: .9rem 1.5rem;
        font-size: 1.1rem;
        border-radius: 0;
    }
}

/* ---------- Main content ---------- */
.site-main {
    flex-grow: 1;
    padding-top: 2rem;
    padding-bottom: 3rem;
}

.section-heading {
    font-size: clamp(1.4rem, 3vw, 1.75rem);
    color: var(--color-ink);
    border-bottom: 2px solid var(--color-green);
    padding-left: .5rem;
    padding-bottom: .4rem;
    margin-bottom: 1.5rem;
    max-width: var(--content-max);
    margin-left: auto;
    margin-right: auto;
}

/* ---------- Feed cards (front page) ---------- */
.feed {
    display: flex;
    flex-direction: column;
    gap: 2rem;
    max-width: var(--content-max);
    margin: 0 auto;
}

.feed-card {
    background-color: var(--color-surface);
    border-radius: var(--radius-card);
    box-shadow: var(--shadow-card);
    overflow: hidden;
    transition: transform .25s ease, box-shadow .25s ease;
}

.feed-card:hover {
    transform: translateY(-4px);
    box-shadow: var(--shadow-card-hover);
}

.card-header-img {
    width: 100%;
    height: clamp(180px, 35vw, 320px);
    object-fit: cover;
}

.card-hero-figure {
    margin: 0;
}

.card-hero-img {
    width: 100%;
    height: auto;
}

.card-body {
    padding: 1.25rem clamp(1.25rem, 4vw, 2rem) 1.75rem;
}

.card-kicker {
    font-size: .8rem;
    font-weight: 700;
    letter-spacing: .08em;
    text-transform: uppercase;
    color: var(--color-green);
    margin-bottom: .35rem;
}

.card-title {
    font-size: clamp(1.3rem, 3vw, 1.6rem);
    margin-bottom: .25rem;
}

.card-tag {
    display: inline-block;
    background-color: var(--color-green);
    color: #ffffff;
    font-size: .7rem;
    font-weight: 700;
    letter-spacing: .08em;
    text-transform: uppercase;
    padding: .2rem .6rem;
    border-radius: 999px;
    margin-bottom: .5rem;
}

.card-date {
    font-size: .85rem;
    color: var(--color-muted);
    margin-bottom: 1rem;
}

.card-text p {
    margin-bottom: 1rem;
    text-align: justify;
}

.card-text p:last-child {
    margin-bottom: 0;
}

.card-external-link {
    display: inline-block;
    background-color: var(--color-green);
    color: #ffffff;
    padding: .6rem 1.25rem;
    border-radius: 4px;
    font-weight: 600;
}

.card-external-link:hover {
    background-color: var(--color-green-dark);
    text-decoration: none;
}

.card-text + .card-link,
.article-body + .card-link {
    margin-top: 1.25rem;
}

/* ---------- Image grid (card images, article images) ---------- */
.image-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 1rem;
    margin-top: 1.5rem;
}

.image-grid img {
    width: 100%;
    height: auto;
    border-radius: var(--radius-img);
}

.grid-item {
    margin: 0;
}

.grid-item .image-caption {
    margin-top: .5rem;
    font-size: .85rem;
}

@media (max-width: 767px) {
    .image-grid {
        grid-template-columns: 1fr;
    }
}

.card-header-figure,
.article-hero-figure {
    margin: 0;
}

.card-header-figure .image-caption {
    margin-top: 0;
    padding: .75rem clamp(1.25rem, 4vw, 2rem) 0;
}

.article-hero-figure .image-caption {
    margin-top: 0;
    padding-top: .75rem;
}

/* ---------- Thumbnail grid ---------- */
.thumb-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
    gap: 1rem;
    margin-top: 1.5rem;
}

.thumb-grid a {
    display: block;
    aspect-ratio: 5 / 7;
    border-radius: var(--radius-img);
    overflow: hidden;
    box-shadow: var(--shadow-card);
}

.thumb-grid img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform .3s ease, opacity .3s ease;
}

.thumb-grid a:hover {
    text-decoration: none;
}

.thumb-grid a:hover img {
    transform: scale(1.05);
    opacity: .8;
}

/* ---------- Lightbox ---------- */
.lightbox {
    display: none;
    position: fixed;
    inset: 0;
    z-index: 200;
    background-color: rgba(0, 0, 0, .85);
}

.lightbox:target {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 1rem;
}

.lightbox-figure {
    margin: 0;
    position: relative;
    z-index: 2;
    text-align: center;
}

.lightbox-figure img {
    max-width: min(96vw, 1600px);
    max-height: calc(100vh - 3rem);
    width: auto;
    height: auto;
    object-fit: contain;
    background-color: #ffffff;
    border-radius: var(--radius-img);
    box-shadow: 0 8px 30px rgba(0, 0, 0, .5);
}

.lightbox-figure .image-caption {
    color: #ffffff;
    margin-top: .75rem;
}

.lightbox-backdrop {
    position: absolute;
    inset: 0;
    z-index: 1;
}

.lightbox-close {
    position: absolute;
    top: .75rem;
    right: .75rem;
    z-index: 3;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 48px;
    height: 48px;
    font-size: 2rem;
    line-height: 1;
    color: #ffffff;
    background-color: rgba(0, 0, 0, .5);
    border-radius: 50%;
}

.lightbox-trigger {
    display: block;
    cursor: zoom-in;
}

.lightbox-close-anchor {
    position: fixed;
    top: 0;
    left: 0;
    width: 1px;
    height: 1px;
    overflow: hidden;
}

@media (hover: hover) {
    .lightbox-trigger:hover img {
        opacity: .85;
    }
}

/* ---------- Article page ---------- */
.article {
    max-width: var(--content-max);
    margin: 0 auto;
    padding-left: clamp(1rem, 4vw, 2rem);
    padding-right: clamp(1rem, 4vw, 2rem);
}

.article-kicker {
    font-size: .8rem;
    font-weight: 700;
    letter-spacing: .08em;
    text-transform: uppercase;
    color: var(--color-green);
    margin-bottom: .35rem;
}

.article h1 {
    font-size: clamp(1.6rem, 4vw, 2.2rem);
    margin-bottom: .35rem;
}

.article-date {
    font-size: .9rem;
    color: var(--color-muted);
    margin-bottom: 1.5rem;
}

.article-hero {
    width: 100%;
    border-radius: var(--radius-card);
    margin-bottom: 1.75rem;
}

.article-body p {
    margin-bottom: 1.25rem;
    text-align: justify;
}

.back-link {
    display: inline-flex;
    align-items: center;
    gap: .45rem;
    font-size: .9rem;
    font-weight: 600;
    color: var(--color-green);
    background-color: var(--color-green-tint);
    border: 1px solid rgba(38, 93, 7, .3);
    border-radius: 999px;
    padding: .45rem 1.1rem .45rem .85rem;
    margin-bottom: 1.5rem;
    transition: background-color .15s ease, color .15s ease, border-color .15s ease;
}

.back-link::before {
    content: "\2190";
    line-height: 1;
}

.back-link:hover {
    background-color: var(--color-green);
    border-color: var(--color-green);
    color: #ffffff;
    text-decoration: none;
}

.back-link:focus-visible {
    outline: 2px solid var(--color-green-dark);
    outline-offset: 2px;
}

.article h2 {
    font-size: clamp(1.3rem, 3vw, 1.6rem);
    margin-top: 2rem;
    margin-bottom: 1rem;
}

.article-subtitle {
    margin-top: 0;
}

.article h3 {
    font-size: 1.1rem;
    margin-top: 2rem;
    margin-bottom: .75rem;
}

.article > p {
    margin-bottom: 1.25rem;
}

.section-heading + .article > :first-child {
    margin-top: 0;
}

.page-section + .page-section {
    margin-top: 3rem;
    padding-top: 2.5rem;
    border-top: 2px solid var(--color-line);
}

.page-section > h2:first-child {
    margin-top: 0;
}

.lead-underline {
    text-align: center;
    margin-bottom: .5rem;
}

.image-caption {
    margin-top: .75rem;
    text-align: center;
}

.todo {
    color: var(--color-muted);
    border: 1px dashed var(--color-line);
    border-radius: var(--radius-img);
    padding: .75rem 1rem;
}

/* ---------- Topic cards ---------- */
.topic-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 1.5rem;
    max-width: var(--content-max);
    margin-left: auto;
    margin-right: auto;
}

@media (max-width: 767px) {
    .topic-grid {
        grid-template-columns: 1fr;
    }
}

.topic-card {
    position: relative;
    display: block;
    border-radius: var(--radius-card);
    overflow: hidden;
    box-shadow: var(--shadow-card);
    background-color: var(--color-green-dark);
    color: #ffffff;
    min-height: 220px;
}

.topic-card:hover {
    text-decoration: none;
    box-shadow: var(--shadow-card-hover);
}

.topic-card img {
    width: 100%;
    height: 100%;
    position: absolute;
    inset: 0;
    object-fit: cover;
    transition: transform .3s ease, opacity .3s ease;
}

.topic-card:hover img {
    transform: scale(1.05);
    opacity: .75;
}

.topic-overlay {
    position: relative;
    z-index: 1;
    display: flex;
    flex-direction: column;
    justify-content: flex-end;
    min-height: 220px;
    padding: 1.5rem;
    background: linear-gradient(to top, rgba(19, 47, 3, .85) 0%, rgba(19, 47, 3, .35) 55%, transparent 100%);
}

.topic-overlay h2 {
    color: #ffffff;
    font-size: 1.5rem;
    letter-spacing: .04em;
}

.topic-overlay p {
    color: var(--color-nav-link);
    font-size: .95rem;
    font-style: italic;
}

/* ---------- Archive list ---------- */
.archive {
    max-width: var(--content-max);
    margin: 0 auto;
}

.archive-year {
    font-size: 1.4rem;
    color: var(--color-ink);
    border-bottom: 2px solid var(--color-green);
    padding-bottom: .35rem;
    margin-top: 2.5rem;
    margin-bottom: .75rem;
}

.archive-list li a {
    display: flex;
    justify-content: space-between;
    align-items: baseline;
    gap: 1rem;
    padding: .7rem 1rem;
    border-radius: 6px;
    color: var(--color-ink);
}

.archive-list li a:hover {
    background-color: var(--color-green-tint);
    color: var(--color-green-dark);
    text-decoration: none;
}

.archive-list .item-title {
    flex: 1;
}

.archive-list .item-date {
    font-size: .85rem;
    color: var(--color-muted);
    white-space: nowrap;
}

.archive-text-entry a {
    display: block;
}

.item-description {
    font-size: .85rem;
    color: var(--color-muted);
    padding: 0 1rem .7rem;
}

/* ---------- Footer ---------- */
.site-footer {
    background-color: var(--color-green-dark);
    color: var(--color-nav-link);
    padding: 0.5rem 0;
    margin-top: 1rem;
}

.footer-inner {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: .5rem;
    text-align: center;
}

.site-footer a {
    color: #ffffff;
}
