:root {
    --font-main: Tahoma, Arial, sans-serif;
    --bg: #fbfbf8;
    --surface: #ffffff;
    --ink: #20231f;
    --muted: #6b7168;
    --line: #deded6;
    --green: #2f6f5e;
    --green-dark: #1f4c41;
    --coral: #c85f4b;
    --amber: #d49a2f;
    --danger: #b33a3a;
    --shadow: 0 18px 50px rgba(32, 35, 31, 0.08);
    --radius: 8px;
}

* {
    box-sizing: border-box;
}

html {
    min-width: 320px;
}

body {
    margin: 0;
    background: var(--bg);
    color: var(--ink);
    font-family: var(--font-main);
    font-size: 16px;
    line-height: 1.7;
}

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

a {
    color: inherit;
    text-decoration: none;
}

button,
input,
select,
textarea {
    font: inherit;
}

.container {
    width: min(1120px, calc(100% - 32px));
    margin: 0 auto;
}

.container.narrow {
    width: min(820px, calc(100% - 32px));
}

.site-header {
    position: sticky;
    top: 0;
    z-index: 20;
    background: rgba(251, 251, 248, 0.94);
    border-bottom: 1px solid var(--line);
    backdrop-filter: blur(14px);
}

.nav-wrap {
    display: flex;
    min-height: 72px;
    align-items: center;
    justify-content: space-between;
    gap: 24px;
}

.brand {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    font-weight: 800;
    letter-spacing: 0;
}

.brand-mark {
    display: inline-grid;
    width: 40px;
    height: 40px;
    place-items: center;
    border-radius: var(--radius);
    background: var(--green);
    color: #fff;
    font-size: 13px;
}

.main-nav {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: flex-end;
    gap: 8px;
}

.main-nav a {
    border-radius: var(--radius);
    color: var(--muted);
    font-size: 14px;
    font-weight: 700;
    padding: 8px 12px;
}

.main-nav a:hover,
.main-nav a.active {
    background: #edf4ef;
    color: var(--green-dark);
}

.main-nav .admin-link {
    border: 1px solid var(--line);
    background: var(--surface);
    color: var(--ink);
}

.page-hero {
    padding: 72px 0 56px;
    border-bottom: 1px solid var(--line);
    background: #f4f3ea;
}

.compact-hero {
    padding: 52px 0;
}

.hero-grid {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(320px, 420px);
    gap: 36px;
    align-items: end;
}

.eyebrow {
    margin: 0 0 10px;
    color: var(--coral);
    font-size: 13px;
    font-weight: 800;
    text-transform: uppercase;
}

h1,
h2,
h3,
p {
    margin-top: 0;
}

h1 {
    max-width: 900px;
    margin-bottom: 16px;
    font-size: clamp(34px, 5vw, 58px);
    line-height: 1.15;
}

h2 {
    margin-bottom: 10px;
    font-size: 28px;
    line-height: 1.3;
}

h3 {
    margin-bottom: 10px;
    font-size: 21px;
    line-height: 1.35;
}

.page-hero p {
    max-width: 720px;
    margin-bottom: 0;
    color: var(--muted);
    font-size: 18px;
}

.content-section {
    padding: 34px 0;
}

.section-head {
    display: flex;
    align-items: end;
    justify-content: space-between;
    gap: 20px;
    margin-bottom: 18px;
}

.section-head h1,
.section-head h2 {
    margin-bottom: 0;
}

.post-count {
    color: var(--muted);
    font-size: 14px;
    font-weight: 700;
}

.search-box,
.filter-panel,
.form-panel,
.table-panel,
.empty-state,
.info-band {
    border: 1px solid var(--line);
    border-radius: var(--radius);
    background: var(--surface);
    box-shadow: var(--shadow);
}

.search-box {
    padding: 22px;
}

.search-box label,
.filter-panel label,
.form-panel label {
    display: grid;
    gap: 8px;
    color: var(--ink);
    font-size: 14px;
    font-weight: 800;
}

.search-row {
    display: grid;
    grid-template-columns: 1fr auto;
    gap: 10px;
}

input,
select,
textarea {
    width: 100%;
    border: 1px solid var(--line);
    border-radius: var(--radius);
    background: #fff;
    color: var(--ink);
    padding: 11px 12px;
    outline: none;
}

input:focus,
select:focus,
textarea:focus {
    border-color: var(--green);
    box-shadow: 0 0 0 3px rgba(47, 111, 94, 0.14);
}

textarea {
    min-height: 110px;
    resize: vertical;
}

.btn {
    display: inline-flex;
    min-height: 44px;
    align-items: center;
    justify-content: center;
    border: 1px solid transparent;
    border-radius: var(--radius);
    cursor: pointer;
    font-weight: 800;
    padding: 10px 16px;
    text-align: center;
    transition: transform 0.15s ease, border-color 0.15s ease, background 0.15s ease;
}

.btn:hover {
    transform: translateY(-1px);
}

.btn.primary {
    background: var(--green);
    color: #fff;
}

.btn.primary:hover {
    background: var(--green-dark);
}

.btn.secondary {
    border-color: var(--line);
    background: #f7f7f2;
    color: var(--ink);
}

.btn.ghost {
    border-color: transparent;
    background: transparent;
    color: var(--muted);
}

.btn.danger {
    background: var(--danger);
    color: #fff;
}

.btn.full {
    width: 100%;
}

.text-link,
.read-more,
.row-actions a {
    color: var(--green-dark);
    font-weight: 800;
    text-decoration: underline;
    text-underline-offset: 4px;
}

.danger-link {
    color: var(--danger) !important;
}

.category-bar {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
}

.category-bar a {
    display: inline-flex;
    min-height: 42px;
    align-items: center;
    gap: 10px;
    border: 1px solid var(--line);
    border-radius: var(--radius);
    background: var(--surface);
    color: var(--muted);
    font-weight: 800;
    padding: 8px 14px;
}

.category-bar a.active,
.category-bar a:hover {
    border-color: var(--green);
    background: #edf4ef;
    color: var(--green-dark);
}

.category-bar span {
    display: inline-grid;
    min-width: 24px;
    min-height: 24px;
    place-items: center;
    border-radius: 999px;
    background: #f0d9ce;
    color: #6d2e22;
    font-size: 12px;
}

.post-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 22px;
}

.post-grid.compact {
    grid-template-columns: repeat(3, minmax(0, 1fr));
}

.post-card {
    overflow: hidden;
    border: 1px solid var(--line);
    border-radius: var(--radius);
    background: var(--surface);
    box-shadow: var(--shadow);
}

.post-image {
    display: grid;
    aspect-ratio: 4 / 3;
    place-items: center;
    overflow: hidden;
    background: #e9ece4;
    color: var(--green-dark);
    font-weight: 800;
}

.post-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.25s ease;
}

.post-card:hover .post-image img {
    transform: scale(1.04);
}

.post-card-body {
    padding: 18px;
}

.post-card h3 a:hover {
    color: var(--green-dark);
}

.post-card p {
    margin-bottom: 16px;
    color: var(--muted);
}

.post-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 8px 14px;
    margin-bottom: 10px;
    color: var(--muted);
    font-size: 13px;
    font-weight: 800;
}

.post-meta span:first-child {
    color: var(--coral);
}

.post-meta.large {
    font-size: 15px;
}

.empty-state {
    padding: 42px 24px;
    text-align: center;
}

.empty-state.compact {
    box-shadow: none;
}

.empty-state p {
    color: var(--muted);
}

.post-detail-header {
    padding: 56px 0 28px;
}

.post-detail-header h1 {
    margin-top: 12px;
}

.cover-wide {
    width: min(1180px, calc(100% - 32px));
    margin: 0 auto 38px;
    overflow: hidden;
    border-radius: var(--radius);
}

.cover-wide img {
    width: 100%;
    max-height: 620px;
    object-fit: cover;
}

.post-content-wrap {
    display: grid;
    grid-template-columns: minmax(0, 760px);
    justify-content: center;
}

.post-content {
    color: #2b2f2a;
    font-size: 18px;
    line-height: 1.9;
}

.gallery-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 14px;
}

.gallery-grid figure {
    margin: 0;
    overflow: hidden;
    border-radius: var(--radius);
    background: #e9ece4;
}

.gallery-grid img {
    width: 100%;
    aspect-ratio: 1 / 1;
    object-fit: cover;
}

.about-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 28px;
}

.about-grid p {
    color: var(--muted);
}

.info-band {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 20px;
    padding: 24px;
}

.info-band h2 {
    margin-bottom: 0;
}

.contact-list {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 16px;
}

.contact-item {
    display: grid;
    gap: 8px;
    min-height: 132px;
    align-content: center;
    border: 1px solid var(--line);
    border-radius: var(--radius);
    background: var(--surface);
    box-shadow: var(--shadow);
    padding: 22px;
}

.contact-item span {
    color: var(--coral);
    font-weight: 800;
}

.contact-item strong {
    overflow-wrap: anywhere;
}

.site-footer {
    margin-top: 44px;
    border-top: 1px solid var(--line);
    background: #20231f;
    color: #fff;
}

.footer-grid {
    display: grid;
    grid-template-columns: 1.5fr 1fr 1fr;
    gap: 28px;
    padding: 40px 0;
}

.site-footer h2,
.site-footer h3 {
    margin-bottom: 10px;
}

.site-footer p,
.footer-links {
    color: rgba(255, 255, 255, 0.72);
}

.footer-links {
    display: grid;
    gap: 8px;
    margin: 0;
    padding: 0;
    list-style: none;
}

.footer-links a:hover {
    color: #fff;
}

.footer-bottom {
    border-top: 1px solid rgba(255, 255, 255, 0.14);
    color: rgba(255, 255, 255, 0.62);
    font-size: 14px;
    padding: 16px;
    text-align: center;
}

.admin-page .site-footer {
    margin-top: 24px;
}

.admin-shell {
    padding: 34px 0 20px;
}

.admin-top {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 20px;
    margin-bottom: 18px;
}

.admin-top h1 {
    margin-bottom: 0;
}

.admin-actions,
.form-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
}

.filter-panel {
    display: grid;
    grid-template-columns: minmax(260px, 1fr) 180px 180px auto;
    gap: 12px;
    align-items: end;
    margin-bottom: 18px;
    padding: 16px;
}

.table-panel {
    overflow-x: auto;
}

.admin-table {
    width: 100%;
    min-width: 850px;
    border-collapse: collapse;
}

.admin-table th,
.admin-table td {
    border-bottom: 1px solid var(--line);
    padding: 14px;
    text-align: left;
    vertical-align: middle;
}

.admin-table th {
    background: #f2f2ec;
    color: var(--muted);
    font-size: 13px;
    text-transform: uppercase;
}

.table-title {
    display: flex;
    align-items: center;
    gap: 12px;
}

.table-title img {
    width: 58px;
    height: 58px;
    border-radius: var(--radius);
    object-fit: cover;
}

.table-title span {
    display: block;
    color: var(--muted);
    font-size: 13px;
}

.status {
    display: inline-flex;
    min-height: 28px;
    align-items: center;
    border-radius: 999px;
    font-size: 13px;
    font-weight: 800;
    padding: 2px 10px;
}

.status.published {
    background: #e6f4ea;
    color: #236142;
}

.status.draft {
    background: #f5ead0;
    color: #7a4b0f;
}

.row-actions {
    white-space: nowrap;
}

.row-actions a {
    margin-right: 10px;
}

.form-panel {
    padding: 22px;
}

.login-panel,
.delete-panel {
    width: min(480px, 100%);
    margin: 0 auto;
}

.form-panel form,
.post-form {
    display: grid;
    gap: 16px;
}

.form-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 16px;
}

.seo-box {
    border: 1px solid var(--line);
    border-radius: var(--radius);
    background: #f7f7f2;
    padding: 18px;
}

.seo-box h2,
.media-manager h2 {
    font-size: 20px;
}

.media-manager {
    display: grid;
    grid-template-columns: minmax(0, 360px) minmax(0, 1fr);
    gap: 24px;
    border: 1px solid var(--line);
    border-radius: var(--radius);
    padding: 18px;
}

.current-cover {
    width: 100%;
    max-height: 260px;
    margin-bottom: 10px;
    border-radius: var(--radius);
    object-fit: cover;
}

.check-row {
    display: flex !important;
    grid-template-columns: none !important;
    align-items: center;
    gap: 8px !important;
    margin-bottom: 12px;
}

.check-row input,
.admin-gallery input {
    width: auto;
}

.admin-gallery {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 12px;
    margin-bottom: 12px;
}

.admin-gallery label {
    display: grid;
    gap: 8px;
    font-size: 13px;
}

.admin-gallery img {
    width: 100%;
    aspect-ratio: 1 / 1;
    border-radius: var(--radius);
    object-fit: cover;
}

.alert {
    border-radius: var(--radius);
    margin-bottom: 14px;
    padding: 12px 14px;
    font-weight: 800;
}

.alert.success {
    background: #e6f4ea;
    color: #236142;
}

.alert.danger {
    background: #f9e2df;
    color: var(--danger);
}

@media (max-width: 920px) {
    .hero-grid,
    .post-grid,
    .post-grid.compact,
    .gallery-grid,
    .about-grid,
    .contact-list,
    .footer-grid,
    .media-manager {
        grid-template-columns: 1fr 1fr;
    }

    .hero-grid,
    .media-manager,
    .footer-grid {
        grid-template-columns: 1fr;
    }

    .filter-panel {
        grid-template-columns: 1fr 1fr;
    }
}

@media (max-width: 680px) {
    .container,
    .container.narrow {
        width: min(100% - 24px, 1120px);
    }

    .nav-wrap,
    .admin-top,
    .section-head,
    .info-band {
        align-items: flex-start;
        flex-direction: column;
    }

    .main-nav {
        justify-content: flex-start;
    }

    .page-hero,
    .compact-hero {
        padding: 34px 0;
    }

    h1 {
        font-size: 34px;
    }

    h2 {
        font-size: 24px;
    }

    .search-row,
    .post-grid,
    .post-grid.compact,
    .gallery-grid,
    .about-grid,
    .contact-list,
    .filter-panel,
    .form-grid,
    .admin-gallery {
        grid-template-columns: 1fr;
    }

    .admin-actions,
    .form-actions {
        width: 100%;
    }

    .admin-actions .btn,
    .form-actions .btn,
    .search-row .btn {
        width: 100%;
    }

    .post-content {
        font-size: 17px;
    }
}

/* Visual refresh */
:root {
    --bg: #f7f2ea;
    --surface: #fffdf9;
    --surface-soft: #f3efe6;
    --ink: #161815;
    --muted: #626a61;
    --line: #e3d8ca;
    --green: #245f52;
    --green-dark: #123d34;
    --coral: #c95d4b;
    --amber: #d79b31;
    --sky: #486c8a;
    --danger: #b33a3a;
    --shadow: 0 18px 48px rgba(41, 32, 20, 0.13);
    --shadow-soft: 0 10px 28px rgba(41, 32, 20, 0.09);
}

body {
    background:
        linear-gradient(180deg, rgba(255, 255, 255, 0.42), rgba(247, 242, 234, 0) 260px),
        var(--bg);
}

body,
button,
input,
select,
textarea {
    letter-spacing: 0;
}

h1,
h2,
h3 {
    color: var(--ink);
    letter-spacing: 0;
}

.site-header {
    background: rgba(255, 253, 249, 0.86);
    box-shadow: 0 10px 34px rgba(34, 27, 18, 0.06);
}

.nav-wrap {
    min-height: 76px;
}

.brand {
    font-size: 18px;
}

.brand-mark {
    background: linear-gradient(135deg, var(--green), var(--sky));
    box-shadow: 0 8px 22px rgba(36, 95, 82, 0.25);
}

.main-nav a {
    color: #4e574d;
    transition: color 0.18s ease, background 0.18s ease, border-color 0.18s ease;
}

.main-nav a:hover,
.main-nav a.active {
    background: rgba(36, 95, 82, 0.1);
    color: var(--green-dark);
}

.main-nav .admin-link {
    border-color: rgba(36, 95, 82, 0.22);
    background: rgba(255, 255, 255, 0.74);
}

.page-hero {
    position: relative;
    isolation: isolate;
    overflow: hidden;
    min-height: 340px;
    display: grid;
    align-items: center;
    border-bottom: 0;
    background:
        linear-gradient(90deg, rgba(14, 17, 15, 0.82), rgba(14, 17, 15, 0.56) 46%, rgba(14, 17, 15, 0.18)),
        url("../images/hero-photo-blog.png") center / cover no-repeat;
    color: #fff;
}

.page-hero::after {
    content: "";
    position: absolute;
    inset: auto 0 0;
    height: 46%;
    z-index: -1;
    background: linear-gradient(180deg, rgba(247, 242, 234, 0), var(--bg));
}

.page-hero h1,
.page-hero p,
.page-hero .eyebrow {
    color: #fff;
    text-shadow: 0 2px 18px rgba(0, 0, 0, 0.25);
}

.page-hero .eyebrow {
    color: #ffd8b5;
}

.page-hero p {
    color: rgba(255, 255, 255, 0.86);
}

.home-hero {
    min-height: min(680px, calc(100vh - 52px));
    padding: 96px 0 128px;
    background:
        linear-gradient(90deg, rgba(13, 18, 17, 0.86), rgba(13, 18, 17, 0.58) 48%, rgba(13, 18, 17, 0.22)),
        var(--hero-image) center / cover no-repeat;
}

.hero-copy {
    display: grid;
    gap: 18px;
    align-content: center;
}

.hero-copy h1 {
    width: min(900px, 100%);
    margin-bottom: 0;
    font-size: clamp(40px, 6vw, 78px);
    line-height: 1.06;
}

.hero-copy > p {
    width: min(660px, 100%);
    font-size: 20px;
    line-height: 1.8;
}

.hero-stats {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin-top: 10px;
}

.hero-stats span,
.hero-stats a {
    display: inline-flex;
    min-height: 44px;
    align-items: center;
    gap: 8px;
    border: 1px solid rgba(255, 255, 255, 0.24);
    border-radius: var(--radius);
    background: rgba(255, 255, 255, 0.14);
    color: #fff;
    font-weight: 800;
    padding: 8px 14px;
    backdrop-filter: blur(12px);
}

.hero-stats strong {
    color: #ffd8b5;
    font-size: 22px;
    line-height: 1;
}

.hero-stats a {
    background: #fff;
    color: var(--green-dark);
}

.search-dock {
    position: relative;
    z-index: 3;
    margin-top: -74px;
}

.elevated-search {
    display: grid;
    grid-template-columns: 190px minmax(0, 1fr);
    gap: 18px;
    align-items: end;
    padding: 22px;
    border: 1px solid rgba(255, 255, 255, 0.8);
    background: rgba(255, 253, 249, 0.94);
    box-shadow: 0 24px 70px rgba(34, 27, 18, 0.18);
    backdrop-filter: blur(18px);
}

.elevated-search label {
    color: var(--green-dark);
    font-size: 15px;
}

.search-row {
    gap: 12px;
}

input,
select,
textarea {
    border-color: #dacfc0;
    background: #fffdf9;
}

input::placeholder {
    color: #9c9286;
}

.btn {
    box-shadow: 0 8px 20px rgba(41, 32, 20, 0.08);
}

.btn.primary {
    background: linear-gradient(135deg, var(--green), var(--green-dark));
}

.btn.secondary {
    background: #fff8ee;
}

.text-link,
.read-more,
.row-actions a {
    color: var(--green);
    text-decoration-thickness: 2px;
}

.category-section {
    padding-top: 42px;
}

.section-head {
    margin-bottom: 22px;
}

.section-head h2 {
    font-size: clamp(25px, 3vw, 34px);
}

.eyebrow {
    color: var(--coral);
}

.category-bar {
    gap: 12px;
}

.category-bar a {
    min-height: 48px;
    border-color: rgba(36, 95, 82, 0.15);
    background: rgba(255, 253, 249, 0.82);
    box-shadow: var(--shadow-soft);
}

.category-bar a.active,
.category-bar a:hover {
    border-color: rgba(36, 95, 82, 0.5);
    background: #e9f1ea;
}

.category-bar span {
    background: #ffe3cc;
    color: #783e23;
}

.post-grid {
    grid-template-columns: repeat(6, minmax(0, 1fr));
    gap: 24px;
}

.post-card {
    grid-column: span 2;
    position: relative;
    overflow: hidden;
    border-color: rgba(41, 32, 20, 0.1);
    background: var(--surface);
    box-shadow: var(--shadow-soft);
    transition: transform 0.22s ease, box-shadow 0.22s ease, border-color 0.22s ease;
}

.post-card:hover {
    transform: translateY(-5px);
    border-color: rgba(36, 95, 82, 0.26);
    box-shadow: 0 24px 62px rgba(41, 32, 20, 0.17);
}

.post-card-featured {
    grid-column: span 3;
}

.post-grid > .post-card:only-child {
    grid-column: 1 / -1;
}

.post-card-featured .post-image {
    aspect-ratio: 16 / 10;
}

.post-image {
    position: relative;
    aspect-ratio: 4 / 3;
    background:
        linear-gradient(135deg, rgba(36, 95, 82, 0.92), rgba(72, 108, 138, 0.86)),
        url("../images/hero-photo-blog.png") center / cover no-repeat;
}

.post-image::after {
    content: "";
    position: absolute;
    inset: 45% 0 0;
    background: linear-gradient(180deg, rgba(0, 0, 0, 0), rgba(0, 0, 0, 0.34));
    pointer-events: none;
}

.post-image img {
    position: absolute;
    inset: 0;
}

.image-placeholder {
    position: relative;
    z-index: 1;
    color: #fff;
    font-size: 18px;
    text-shadow: 0 2px 14px rgba(0, 0, 0, 0.26);
}

.image-badge {
    position: absolute;
    right: 12px;
    bottom: 12px;
    z-index: 2;
    border: 1px solid rgba(255, 255, 255, 0.34);
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.86);
    color: var(--green-dark);
    font-size: 12px;
    font-weight: 900;
    line-height: 1;
    padding: 8px 10px;
    backdrop-filter: blur(10px);
}

.post-card-body {
    display: grid;
    gap: 10px;
    padding: 20px;
}

.post-card h3 {
    margin-bottom: 0;
    font-size: clamp(20px, 2vw, 24px);
}

.post-card p {
    margin-bottom: 2px;
}

.post-meta {
    margin-bottom: 0;
}

.read-more {
    justify-self: start;
}

.empty-state {
    background:
        linear-gradient(135deg, rgba(255, 248, 238, 0.92), rgba(233, 241, 234, 0.94)),
        var(--surface);
}

.post-detail-header {
    width: min(900px, calc(100% - 32px));
    padding: 68px 0 30px;
}

.post-detail-header h1 {
    margin: 14px 0 14px;
    font-size: clamp(36px, 5vw, 68px);
}

.cinematic-cover {
    position: relative;
    box-shadow: 0 28px 80px rgba(41, 32, 20, 0.18);
}

.cinematic-cover::after {
    content: "";
    position: absolute;
    inset: 0;
    border: 1px solid rgba(255, 255, 255, 0.42);
    border-radius: var(--radius);
    pointer-events: none;
}

.cover-wide img {
    min-height: 360px;
}

.post-content-wrap {
    grid-template-columns: minmax(0, 820px);
}

.post-content {
    border-left: 4px solid #ead3b6;
    background: rgba(255, 253, 249, 0.62);
    box-shadow: 0 18px 50px rgba(41, 32, 20, 0.07);
    padding: 28px 32px;
}

.gallery-grid {
    gap: 18px;
}

.gallery-grid figure {
    box-shadow: var(--shadow-soft);
}

.gallery-grid img {
    transition: transform 0.24s ease;
}

.gallery-grid figure:hover img {
    transform: scale(1.04);
}

.about-grid > div,
.contact-item,
.info-band,
.form-panel,
.table-panel,
.filter-panel {
    border-color: rgba(41, 32, 20, 0.1);
    background: rgba(255, 253, 249, 0.9);
}

.about-grid > div {
    border: 1px solid rgba(41, 32, 20, 0.1);
    border-radius: var(--radius);
    box-shadow: var(--shadow-soft);
    padding: 24px;
}

.contact-item {
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

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

.site-footer {
    background:
        linear-gradient(135deg, rgba(18, 61, 52, 0.92), rgba(22, 24, 21, 0.96)),
        #161815;
}

.footer-grid {
    padding: 48px 0;
}

@media (max-width: 1080px) {
    .post-card,
    .post-card-featured {
        grid-column: span 3;
    }
}

@media (max-width: 920px) {
    .home-hero {
        min-height: 560px;
        padding: 76px 0 112px;
    }

    .elevated-search {
        grid-template-columns: 1fr;
    }

    .post-grid,
    .post-grid.compact {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .post-card,
    .post-card-featured {
        grid-column: auto;
    }
}

@media (max-width: 680px) {
    .site-header {
        position: static;
    }

    .nav-wrap {
        gap: 14px;
        padding: 14px 0;
    }

    .main-nav a {
        padding: 7px 10px;
    }

    .page-hero {
        min-height: 360px;
        background-position: 62% center;
    }

    .home-hero {
        min-height: 590px;
        padding: 46px 0 120px;
        background-position: 60% center;
    }

    .hero-copy h1 {
        font-size: 40px;
    }

    .hero-copy > p {
        font-size: 17px;
    }

    .hero-stats {
        display: grid;
        grid-template-columns: 1fr;
        width: 100%;
    }

    .hero-stats span,
    .hero-stats a {
        justify-content: center;
    }

    .search-dock {
        margin-top: -88px;
    }

    .elevated-search {
        padding: 18px;
    }

    .post-grid,
    .post-grid.compact {
        grid-template-columns: 1fr;
        gap: 18px;
    }

    .post-card:hover,
    .contact-item:hover {
        transform: none;
    }

    .post-card-body,
    .post-content {
        padding: 20px;
    }

    .cover-wide img {
        min-height: 260px;
    }

    .about-grid > div {
        padding: 20px;
    }
}

/* Admin panel upgrade */
.admin-layout {
    display: grid;
    grid-template-columns: 260px minmax(0, 1fr);
    gap: 24px;
    align-items: start;
}

.admin-sidebar {
    position: sticky;
    top: 96px;
    border: 1px solid rgba(41, 32, 20, 0.1);
    border-radius: var(--radius);
    background: rgba(255, 253, 249, 0.94);
    box-shadow: var(--shadow-soft);
    padding: 16px;
}

.admin-sidebar-head {
    display: flex;
    align-items: center;
    gap: 12px;
    border-bottom: 1px solid var(--line);
    margin-bottom: 12px;
    padding-bottom: 14px;
}

.admin-sidebar-head strong,
.admin-sidebar-head span {
    display: block;
}

.admin-sidebar-head span:not(.brand-mark) {
    color: var(--muted);
    font-size: 13px;
}

.admin-sidebar nav {
    display: grid;
    gap: 6px;
}

.admin-sidebar nav a {
    border-radius: var(--radius);
    color: var(--muted);
    font-weight: 800;
    padding: 10px 12px;
}

.admin-sidebar nav a:hover,
.admin-sidebar nav a.active {
    background: #e9f1ea;
    color: var(--green-dark);
}

.admin-sidebar .logout-link {
    color: var(--danger);
}

.admin-main {
    min-width: 0;
}

.stats-grid {
    display: grid;
    grid-template-columns: repeat(5, minmax(0, 1fr));
    gap: 14px;
    margin-bottom: 22px;
}

.stat-card,
.admin-panel {
    border: 1px solid rgba(41, 32, 20, 0.1);
    border-radius: var(--radius);
    background: rgba(255, 253, 249, 0.92);
    box-shadow: var(--shadow-soft);
}

.stat-card {
    display: grid;
    gap: 8px;
    min-height: 126px;
    align-content: center;
    padding: 18px;
}

.stat-card span {
    color: var(--muted);
    font-weight: 800;
}

.stat-card strong {
    color: var(--green-dark);
    font-size: 36px;
    line-height: 1;
}

.dashboard-grid {
    display: grid;
    grid-template-columns: 0.9fr 1.1fr;
    gap: 20px;
}

.admin-panel {
    padding: 20px;
}

.muted {
    color: var(--muted);
}

.rank-list,
.latest-list {
    display: grid;
    gap: 12px;
}

.rank-item,
.latest-item {
    display: flex;
    align-items: center;
    gap: 12px;
    border: 1px solid var(--line);
    border-radius: var(--radius);
    background: #fffaf2;
    padding: 12px;
}

.rank-item > span {
    display: grid;
    width: 34px;
    height: 34px;
    place-items: center;
    border-radius: 999px;
    background: var(--green);
    color: #fff;
    font-weight: 900;
}

.rank-item small,
.latest-item small,
.media-card span {
    display: block;
    color: var(--muted);
    font-size: 13px;
}

.latest-item img,
.thumb-placeholder {
    width: 64px;
    height: 64px;
    flex: 0 0 64px;
    border-radius: var(--radius);
    object-fit: cover;
}

.thumb-placeholder,
.table-cover.placeholder {
    display: grid;
    place-items: center;
    background: #e9f1ea;
    color: var(--green-dark);
    font-size: 12px;
    font-weight: 900;
    text-align: center;
}

.table-cover {
    width: 72px;
    height: 58px;
    border-radius: var(--radius);
    object-fit: cover;
}

.table-title em {
    display: inline-flex;
    margin-left: 8px;
    border-radius: 999px;
    background: #ffe3cc;
    color: #783e23;
    font-size: 12px;
    font-style: normal;
    font-weight: 900;
    padding: 2px 8px;
}

.admin-check {
    align-content: center;
    border: 1px solid var(--line);
    border-radius: var(--radius);
    background: #fffaf2;
    padding: 12px;
}

.media-upload-form {
    margin-bottom: 18px;
}

.media-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 18px;
}

.media-card {
    overflow: hidden;
    border: 1px solid rgba(41, 32, 20, 0.1);
    border-radius: var(--radius);
    background: var(--surface);
    box-shadow: var(--shadow-soft);
}

.media-card img {
    width: 100%;
    aspect-ratio: 4 / 3;
    object-fit: cover;
}

.media-card > div {
    display: grid;
    gap: 10px;
    padding: 14px;
}

.media-card form {
    margin: 0;
}

.media-card .btn {
    min-height: 38px;
}

.category-row-form {
    display: grid;
    grid-template-columns: 1.1fr 1fr 100px 90px auto auto;
    gap: 10px;
    align-items: center;
}

.category-row-form span {
    color: var(--muted);
    font-weight: 800;
}

.theme-color-grid {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 14px;
    margin-top: 16px;
}

.theme-color-grid label {
    display: grid;
    gap: 8px;
    border: 1px solid var(--line);
    border-radius: var(--radius);
    background: #fffaf2;
    color: var(--ink);
    font-size: 13px;
    font-weight: 800;
    padding: 12px;
}

.theme-color-grid input[type="color"] {
    width: 100%;
    height: 44px;
    cursor: pointer;
    padding: 3px;
}

.theme-preview-box {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 14px;
    border: 1px solid var(--line);
    border-radius: var(--radius);
    background: var(--surface);
    margin-top: 18px;
    padding: 16px;
}

.theme-preview-box div {
    flex: 1 1 260px;
}

.theme-preview-box h3,
.theme-preview-box p {
    margin-bottom: 4px;
}

.gallery-grid figcaption {
    background: rgba(255, 253, 249, 0.92);
    color: var(--muted);
    font-size: 14px;
    padding: 10px 12px;
}

@media (max-width: 1080px) {
    .admin-layout {
        grid-template-columns: 1fr;
    }

    .admin-sidebar {
        position: static;
    }

    .admin-sidebar nav {
        grid-template-columns: repeat(3, minmax(0, 1fr));
    }

    .stats-grid {
        grid-template-columns: repeat(3, minmax(0, 1fr));
    }

    .dashboard-grid,
    .media-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

@media (max-width: 720px) {
    .admin-sidebar nav,
    .stats-grid,
    .dashboard-grid,
    .media-grid,
    .theme-color-grid,
    .category-row-form {
        grid-template-columns: 1fr;
    }

    .stat-card {
        min-height: 104px;
    }
}

/* Memory scrapbook theme */
.memory-theme,
.memory-theme button,
.memory-theme input,
.memory-theme select,
.memory-theme textarea {
    font-family: var(--font-main);
}

.memory-theme {
    background:
        radial-gradient(circle at 0 18%, rgba(218, 171, 110, 0.16), transparent 28%),
        radial-gradient(circle at 100% 8%, rgba(207, 129, 87, 0.13), transparent 24%),
        linear-gradient(180deg, #fff8ee 0, var(--bg) 420px, #f5e5ce 100%);
    color: var(--ink);
}

.memory-theme::before {
    content: "";
    position: fixed;
    inset: 0;
    z-index: -1;
    pointer-events: none;
    background-image:
        linear-gradient(rgba(111, 71, 41, 0.035) 1px, transparent 1px),
        linear-gradient(90deg, rgba(111, 71, 41, 0.025) 1px, transparent 1px);
    background-size: 42px 42px, 42px 42px;
    opacity: 0.75;
}

.memory-header {
    background: rgba(255, 248, 237, 0.92);
    border-bottom: 1px solid rgba(111, 71, 41, 0.16);
    box-shadow: 0 10px 34px rgba(111, 71, 41, 0.08);
}

.memory-brand {
    color: var(--green-dark);
    font-size: 25px;
    font-weight: 900;
}

.memory-brand-mark {
    width: 36px;
    height: 36px;
    background: transparent;
    box-shadow: none;
    color: var(--green-dark);
    font-size: 34px;
    transform: rotate(-18deg);
}

.memory-nav {
    gap: 18px;
}

.memory-nav a {
    border-radius: 0;
    color: #56361f;
    font-size: 15px;
    padding: 9px 0;
}

.memory-nav a:hover,
.memory-nav a.active {
    background: transparent;
    color: var(--green);
    box-shadow: inset 0 -2px 0 var(--green);
}

.memory-header-actions {
    display: flex;
    align-items: center;
    gap: 12px;
}

.memory-write-link {
    display: inline-flex;
    min-height: 42px;
    align-items: center;
    border-radius: 999px;
    background: linear-gradient(135deg, var(--green), var(--coral));
    color: #fff;
    font-weight: 900;
    padding: 9px 20px;
    box-shadow: 0 12px 28px rgba(207, 129, 87, 0.24);
}

.memory-icon-link {
    display: grid;
    width: 38px;
    height: 38px;
    place-items: center;
    border: 1px solid rgba(111, 71, 41, 0.18);
    border-radius: 999px;
    color: var(--green-dark);
    font-size: 22px;
}

.memory-hero {
    position: relative;
    overflow: hidden;
    min-height: 430px;
    border-bottom: 1px solid rgba(111, 71, 41, 0.13);
    background:
        linear-gradient(90deg, rgba(255, 247, 234, 0.98), rgba(255, 247, 234, 0.82) 36%, rgba(255, 247, 234, 0.16) 70%),
        var(--hero-image) center / cover no-repeat;
}

.memory-hero::before,
.memory-hero::after {
    content: "";
    position: absolute;
    pointer-events: none;
    opacity: 0.55;
}

.memory-hero::before {
    left: 28px;
    top: 72px;
    width: 150px;
    height: 230px;
    border-left: 3px solid rgba(180, 137, 82, 0.28);
    border-radius: 50%;
    transform: rotate(16deg);
}

.memory-hero::after {
    right: 26px;
    bottom: 22px;
    width: 180px;
    height: 80px;
    border: 2px dashed rgba(111, 71, 41, 0.18);
    border-radius: 50%;
    transform: rotate(-12deg);
}

.memory-hero-grid {
    position: relative;
    display: grid;
    grid-template-columns: minmax(0, 560px) minmax(260px, 1fr);
    gap: 32px;
    align-items: center;
    min-height: 430px;
    padding: 58px 0;
}

.memory-hero-copy {
    padding-left: 98px;
}

.memory-hero-copy h1 {
    max-width: 680px;
    color: #2f2116;
    font-size: clamp(38px, 4.8vw, 64px);
    line-height: 1.16;
    margin-bottom: 18px;
}

.memory-hero-copy p {
    max-width: 520px;
    color: var(--muted);
    font-size: 18px;
    line-height: 1.9;
}

.memory-hero-copy .eyebrow {
    color: var(--green);
}

.memory-hero-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    margin-top: 22px;
}

.memory-write-btn {
    border-radius: 999px;
    padding-inline: 24px;
}

.memory-hero-note {
    justify-self: end;
    width: min(220px, 100%);
    margin-right: 26px;
    border: 1px solid rgba(111, 71, 41, 0.16);
    border-radius: 6px;
    background: rgba(255, 246, 230, 0.76);
    box-shadow: 0 16px 32px rgba(111, 71, 41, 0.12);
    color: var(--green-dark);
    padding: 24px;
    transform: rotate(4deg);
}

.memory-hero-note span,
.memory-hero-note strong,
.memory-hero-note em {
    display: block;
}

.memory-hero-note span {
    color: var(--muted);
}

.memory-hero-note strong {
    font-size: 24px;
}

.memory-hero-note em {
    color: var(--coral);
    font-style: normal;
}

.memory-search-band {
    margin-top: -28px;
}

.memory-search {
    display: grid;
    grid-template-columns: 180px minmax(0, 1fr);
    align-items: end;
    gap: 16px;
    border: 1px solid rgba(111, 71, 41, 0.14);
    border-radius: 10px;
    background: rgba(255, 248, 237, 0.94);
    box-shadow: 0 18px 42px rgba(111, 71, 41, 0.13);
    padding: 18px;
}

.memory-search label {
    color: var(--green-dark);
    font-weight: 900;
}

.memory-main-grid,
.memory-lower-grid {
    display: grid;
    grid-template-columns: minmax(0, 1.55fr) minmax(320px, 0.9fr);
    gap: 34px;
}

.memory-section-title {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    margin-bottom: 16px;
}

.memory-section-title h2 {
    position: relative;
    margin: 0;
    color: var(--green-dark);
    font-size: 26px;
}

.memory-section-title h2::before {
    content: "";
    display: inline-block;
    width: 4px;
    height: 22px;
    margin-right: 10px;
    border-radius: 999px;
    background: var(--green);
    vertical-align: -3px;
}

.memory-section-title.compact {
    margin-bottom: 14px;
}

.memory-card-grid {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 16px;
}

.memory-card,
.memory-date-card,
.memory-categories-panel,
.memory-timeline-panel {
    border: 1px solid rgba(111, 71, 41, 0.15);
    border-radius: 9px;
    background: rgba(255, 248, 237, 0.86);
    box-shadow: 0 14px 30px rgba(111, 71, 41, 0.1);
}

.memory-card {
    overflow: hidden;
}

.memory-card-image {
    position: relative;
    display: block;
    aspect-ratio: 1.45 / 1;
    overflow: hidden;
    background: #e7d2b9;
}

.memory-card-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    filter: sepia(0.12) saturate(0.92);
    transition: transform 0.24s ease;
}

.memory-card:hover img {
    transform: scale(1.04);
}

.memory-card-image span {
    position: absolute;
    left: 10px;
    bottom: 8px;
    border-radius: 999px;
    background: rgba(255, 246, 230, 0.9);
    color: var(--green-dark);
    font-size: 12px;
    font-weight: 900;
    padding: 4px 10px;
}

.memory-card-body {
    padding: 14px;
}

.memory-card-body h3 {
    margin-bottom: 8px;
    font-size: 18px;
}

.memory-card-body p {
    color: var(--muted);
    font-size: 14px;
    line-height: 1.65;
}

.memory-today-card {
    border-left: 1px solid rgba(111, 71, 41, 0.14);
    padding-left: 28px;
}

.memory-date-card {
    position: relative;
    display: grid;
    grid-template-columns: 110px minmax(0, 1fr);
    gap: 18px;
    align-items: center;
    padding: 22px;
}

.memory-date-card::after {
    content: "";
    position: absolute;
    right: -10px;
    bottom: -12px;
    width: 94px;
    height: 64px;
    border-radius: 50%;
    border: 2px dashed rgba(111, 71, 41, 0.2);
    transform: rotate(-14deg);
}

.memory-date {
    text-align: center;
    color: var(--green-dark);
}

.memory-date strong {
    display: block;
    font-size: 56px;
    line-height: 1;
}

.memory-date span {
    display: block;
    font-weight: 900;
}

.memory-date-image {
    display: block;
    overflow: hidden;
    border-radius: 5px;
}

.memory-date-image img {
    width: 100%;
    aspect-ratio: 1.45 / 1;
    object-fit: cover;
}

.memory-date-card blockquote {
    grid-column: 1 / -1;
    margin: 0;
    color: var(--green-dark);
    font-size: 18px;
    font-weight: 800;
}

.memory-date-card .read-more {
    grid-column: 1 / -1;
}

.memory-categories-panel,
.memory-timeline-panel {
    padding: 20px;
}

.memory-category-pills {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
}

.memory-category-pills a {
    display: inline-flex;
    min-height: 46px;
    align-items: center;
    gap: 8px;
    border: 1px solid rgba(111, 71, 41, 0.18);
    border-radius: 999px;
    background: #fff2df;
    color: var(--green-dark);
    font-weight: 900;
    padding: 8px 18px;
}

.memory-category-pills a.active,
.memory-category-pills a:hover {
    background: var(--green);
    color: #fff;
}

.memory-category-pills span {
    display: inline-grid;
    min-width: 22px;
    min-height: 22px;
    place-items: center;
    border-radius: 999px;
    background: rgba(111, 71, 41, 0.12);
    font-size: 12px;
}

.memory-timeline {
    position: relative;
    display: grid;
    grid-template-columns: repeat(5, minmax(0, 1fr));
    gap: 12px;
    padding-top: 18px;
}

.memory-timeline::before {
    content: "";
    position: absolute;
    top: 36px;
    left: 8%;
    right: 8%;
    border-top: 2px dashed rgba(207, 129, 87, 0.5);
}

.memory-timeline a {
    position: relative;
    z-index: 1;
    display: grid;
    justify-items: center;
    gap: 6px;
    color: var(--green-dark);
    text-align: center;
}

.memory-timeline a > span {
    display: grid;
    width: 44px;
    height: 44px;
    place-items: center;
    border: 2px solid #f3d8b5;
    border-radius: 999px;
    background: #fff7eb;
    color: var(--green);
    font-weight: 900;
}

.memory-timeline strong {
    font-size: 13px;
}

.memory-timeline small {
    color: var(--muted);
}

.memory-footer {
    position: relative;
    overflow: hidden;
    margin-top: 30px;
    border-top: 1px solid rgba(111, 71, 41, 0.14);
    background:
        linear-gradient(180deg, rgba(255, 248, 237, 0.88), rgba(239, 218, 190, 0.96)),
        #efdabc;
    color: var(--green-dark);
}

.memory-footer::before {
    content: "";
    position: absolute;
    inset: 0;
    background-image:
        radial-gradient(circle at 5% 20%, rgba(111, 71, 41, 0.12), transparent 12%),
        radial-gradient(circle at 96% 80%, rgba(207, 129, 87, 0.13), transparent 14%);
    pointer-events: none;
}

.memory-footer-grid {
    position: relative;
    display: grid;
    grid-template-columns: 1.25fr 1fr 0.75fr 0.75fr 1fr;
    gap: 28px;
    padding: 42px 0 26px;
}

.memory-footer h3,
.memory-footer h2,
.memory-footer p,
.memory-footer .footer-links {
    color: var(--green-dark);
}

.memory-footer-quote p {
    color: var(--muted);
    font-size: 22px;
    line-height: 1.55;
}

.memory-footer .footer-links a:hover {
    color: var(--green);
}

.memory-footer .footer-bottom {
    position: relative;
    border-top-color: rgba(111, 71, 41, 0.14);
    color: var(--muted);
}

@media (max-width: 1100px) {
    .memory-nav {
        gap: 12px;
    }

    .memory-header-actions {
        width: 100%;
        justify-content: flex-end;
    }

    .memory-hero-copy {
        padding-left: 20px;
    }

    .memory-card-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .memory-footer-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

@media (max-width: 820px) {
    .memory-header .nav-wrap {
        align-items: flex-start;
        flex-direction: column;
    }

    .memory-header-actions {
        justify-content: flex-start;
    }

    .memory-hero {
        background:
            linear-gradient(180deg, rgba(255, 247, 234, 0.98), rgba(255, 247, 234, 0.82) 58%, rgba(255, 247, 234, 0.2)),
            var(--hero-image) 68% center / cover no-repeat;
    }

    .memory-hero-grid,
    .memory-main-grid,
    .memory-lower-grid {
        grid-template-columns: 1fr;
    }

    .memory-hero-grid {
        min-height: 560px;
    }

    .memory-hero-note {
        justify-self: start;
        margin-left: 20px;
    }

    .memory-search {
        grid-template-columns: 1fr;
    }

    .memory-today-card {
        border-left: 0;
        padding-left: 0;
    }

    .memory-timeline {
        grid-template-columns: 1fr;
    }

    .memory-timeline::before {
        display: none;
    }
}

@media (max-width: 560px) {
    .memory-brand {
        font-size: 22px;
    }

    .memory-write-link {
        width: 100%;
        justify-content: center;
    }

    .memory-hero-copy {
        padding-left: 0;
    }

    .memory-hero-copy h1 {
        font-size: 38px;
    }

    .memory-card-grid,
    .memory-date-card,
    .memory-footer-grid {
        grid-template-columns: 1fr;
    }

    .memory-date-card::after {
        display: none;
    }
}
