* { box-sizing: border-box; }

:root {
    --champagne: #F7E7CE;
    --gold: #C9A24D;
    --blush: #E8B4BC;
    --text-dark: #3A3A3A;
    --white: #FFFFFF;
}

body {
    margin: 0;
    color: var(--text-dark);
    background: var(--champagne);
    font-family: Georgia, "Times New Roman", serif;
}

.post-page {
    min-height: 100vh;
    display: grid;
    place-items: center;
    padding: 22px;
    background:
        radial-gradient(circle at top, rgba(255,255,255,.8), transparent 45%),
        var(--champagne);
}

.post-card {
    width: min(620px, 100%);
    background: rgba(255,255,255,.96);
    padding: 34px;
    border: 1px solid rgba(201,162,77,.45);
    border-radius: 20px;
    box-shadow: 0 15px 45px rgba(58,58,58,.12);
    text-align: center;
}

.brand-mark {
    width: 58px;
    height: 58px;
    margin: 0 auto 12px;
    border: 1px solid var(--gold);
    border-radius: 50%;
    display: grid;
    place-items: center;
    color: var(--gold);
    font-size: 28px;
    font-style: italic;
}

.brand-mark.small {
    width: 46px;
    height: 46px;
    margin: 0;
    font-size: 22px;
    flex: 0 0 auto;
}

.brand-mark.tiny {
    width: 34px;
    height: 34px;
    font-size: 17px;
    margin: 0 auto 6px;
}

.eyebrow {
    letter-spacing: 4px;
    font-size: 11px;
    color: var(--gold);
    font-weight: bold;
}

h1 {
    font-weight: normal;
    margin: 8px 0;
}

.subtitle, .intro p {
    color: #756d65;
}

label {
    display: block;
    text-align: left;
    margin: 18px 0 7px;
    font-weight: bold;
}

input, textarea {
    width: 100%;
    border: 1px solid #d8c9b2;
    background: #fffdf9;
    border-radius: 10px;
    padding: 12px;
    font: inherit;
    color: var(--text-dark);
}

small {
    display: block;
    text-align: left;
    color: #81776c;
    margin-top: 7px;
}

button, .secondary-button {
    display: inline-block;
    border: 0;
    border-radius: 999px;
    padding: 12px 18px;
    font-family: Georgia, "Times New Roman", serif;
    cursor: pointer;
}

form > button {
    width: 100%;
    margin-top: 22px;
    background: var(--gold);
    color: white;
}

.secondary-button {
    margin-top: 12px;
    background: transparent;
    color: var(--text-dark);
    border: 1px solid var(--gold);
    text-decoration: none;
}

.notice {
    padding: 12px;
    margin: 16px 0;
    border-radius: 10px;
    background: #f5ead8;
    border: 1px solid #e0c78f;
}

.timeline-page {
    max-width: 780px;
    margin: auto;
    min-height: 100vh;
}

.site-header {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 25px 18px 8px;
}

.site-header h1 {
    margin: 2px 0 0;
    font-size: 25px;
}

.intro {
    padding: 0 18px 12px;
    text-align: center;
}

.intro p {
    margin: 4px 0;
    font-style: italic;
}

.sort-bar {
    display: flex;
    align-items: center;
    gap: 7px;
    padding: 10px 16px 18px;
    overflow-x: auto;
}

.sort-bar span {
    color: #756d65;
    font-size: 14px;
}

.sort-bar a {
    padding: 8px 13px;
    border-radius: 999px;
    border: 1px solid rgba(201,162,77,.5);
    background: rgba(255,255,255,.5);
    color: var(--text-dark);
    text-decoration: none;
    white-space: nowrap;
    font-size: 14px;
}

.sort-bar a.active {
    background: var(--gold);
    color: #fff;
}

.feed {
    padding: 0 10px 55px;
}

.post {
    background: var(--white);
    margin: 0 0 20px;
    border: 1px solid rgba(201,162,77,.28);
    border-radius: 16px;
    overflow: hidden;
    box-shadow: 0 6px 20px rgba(58,58,58,.08);
}

.post-head {
    padding: 15px 17px 7px;
}

.post-head strong {
    font-size: 17px;
}

.date {
    margin-top: 3px;
    color: #958b80;
    font-size: 12px;
}

.caption {
    padding: 0 17px;
    line-height: 1.5;
}

.media-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 2px;
    background: #ddd;
}

.media-grid.count-1 {
    grid-template-columns: 1fr;
}

.media-item {
    position: relative;
    background: #000;
    min-width: 0;
}

.media-item img,
.media-item video {
    display: block;
    width: 100%;
    aspect-ratio: 1 / 1;
    object-fit: cover;
}

.media-grid.count-1 img,
.media-grid.count-1 video {
    aspect-ratio: auto;
    max-height: 78vh;
    object-fit: contain;
}

.download {
    position: absolute;
    right: 8px;
    bottom: 8px;
    background: rgba(0,0,0,.68);
    color: #fff;
    padding: 6px 9px;
    border-radius: 999px;
    text-decoration: none;
    font-family: Arial, sans-serif;
    font-size: 11px;
}

.actions {
    display: flex;
    gap: 10px;
    padding: 11px 15px;
    border-bottom: 1px solid #eee5d9;
}

.actions form {
    margin: 0;
}

.actions button {
    background: transparent;
    color: var(--text-dark);
    padding: 5px 7px;
    font-size: 15px;
}

.comments {
    padding: 9px 16px 16px;
}

.comment {
    padding: 5px 0;
    line-height: 1.4;
}

.comment strong {
    margin-right: 7px;
}

.comment-form {
    display: grid;
    grid-template-columns: 120px 1fr auto;
    gap: 7px;
    margin-top: 10px;
}

.comment-form button {
    background: var(--blush);
    color: var(--text-dark);
}

.empty {
    background: rgba(255,255,255,.65);
    border: 1px solid rgba(201,162,77,.3);
    border-radius: 16px;
    padding: 50px 20px;
    text-align: center;
}

.empty h2 {
    font-weight: normal;
}

footer {
    text-align: center;
    padding: 20px;
    color: #8b8176;
    font-size: 12px;
    letter-spacing: 1px;
}

@media (max-width: 600px) {
    .post-card {
        padding: 24px 19px;
    }

    .comment-form {
        grid-template-columns: 1fr;
    }

    .site-header h1 {
        font-size: 21px;
    }
}

/* ================= PHOTO LIGHTBOX ================= */

.gallery-image {
    display: block;
    width: 100%;
    padding: 0;
    margin: 0;
    border: 0;
    border-radius: 0;
    background: transparent;
    cursor: zoom-in;
}

.gallery-image img {
    display: block;
    width: 100%;
}

.lightbox {
    position: fixed;
    inset: 0;
    z-index: 99999;
    display: none;
    align-items: center;
    justify-content: center;
    background: rgba(0, 0, 0, 0.94);
    touch-action: pan-y;
}

.lightbox.open {
    display: flex;
}

.lightbox-image-container {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    height: 100%;
    padding: 60px 55px;
}

.lightbox-image-container img {
    display: block;
    max-width: 100%;
    max-height: 100%;
    width: auto;
    height: auto;
    object-fit: contain;
    user-select: none;
    -webkit-user-select: none;
    -webkit-user-drag: none;
}

.lightbox-close,
.lightbox-prev,
.lightbox-next {
    position: absolute;
    z-index: 100001;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0;
    border: 0;
    color: #fff;
    background: rgba(0, 0, 0, 0.45);
    cursor: pointer;
}

.lightbox-close {
    top: 18px;
    right: 18px;
    width: 44px;
    height: 44px;
    padding: 0;
    border-radius: 50%;
    font-family: Arial, sans-serif;
    font-size: 32px;
    line-height: 1;
}

.lightbox-prev,
.lightbox-next {
    top: 50%;
    transform: translateY(-50%);
    width: 48px;
    height: 70px;
    padding: 0;
    border-radius: 12px;
    font-family: Arial, sans-serif;
    font-size: 48px;
    line-height: 1;
}

.lightbox-prev {
    left: 12px;
}

.lightbox-next {
    right: 12px;
}

.lightbox-close:hover,
.lightbox-prev:hover,
.lightbox-next:hover,
.lightbox-close:focus-visible,
.lightbox-prev:focus-visible,
.lightbox-next:focus-visible {
    background: rgba(255, 255, 255, 0.18);
    outline: 2px solid #fff;
    outline-offset: 2px;
}

.lightbox-counter {
    position: absolute;
    bottom: 18px;
    left: 50%;
    transform: translateX(-50%);
    padding: 6px 12px;
    border-radius: 999px;
    background: rgba(0, 0, 0, 0.55);
    color: #fff;
    font-family: Arial, sans-serif;
    font-size: 13px;
    white-space: nowrap;
}

@media (max-width: 600px) {
    .lightbox-image-container {
        padding: 55px 10px;
    }

    .lightbox-prev,
    .lightbox-next {
        width: 42px;
        height: 60px;
        font-size: 38px;
        background: rgba(0, 0, 0, 0.35);
    }

    .lightbox-prev {
        left: 4px;
    }

    .lightbox-next {
        right: 4px;
    }

    .lightbox-close {
        top: 12px;
        right: 12px;
    }
}

/* ================= CLASSIFIED MEDIA ================= */

.media-item.is-classified {
    background: #050505;
}

.classified-media {
    width: 100%;
    aspect-ratio: 1 / 1;
    min-height: 180px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 18px;
    padding: 28px 16px;
    background:
        repeating-linear-gradient(
            -45deg,
            #050505,
            #050505 14px,
            #101010 14px,
            #101010 28px
        );
    color: #fff;
    text-align: center;
    overflow: hidden;
}

.media-grid.count-1 .classified-media {
    aspect-ratio: 16 / 9;
    min-height: 300px;
}

.classified-stamp {
    padding: 10px 18px;
    border: 3px solid rgba(255, 255, 255, .92);
    font-family: Arial, sans-serif;
    font-size: clamp(20px, 5vw, 34px);
    font-weight: 800;
    letter-spacing: 5px;
    line-height: 1;
    transform: rotate(-5deg);
    box-shadow: 0 0 0 1px rgba(255,255,255,.18) inset;
}

.classified-copy {
    font-family: Arial, sans-serif;
    font-size: 12px;
    font-weight: 700;
    letter-spacing: 3px;
    text-transform: uppercase;
    opacity: .65;
}

/* ================= OWNER ADMIN ================= */

.admin-page {
    min-height: 100vh;
    background: #f2eee7;
    color: #252525;
    font-family: Arial, Helvetica, sans-serif;
}

.admin-shell {
    width: min(1100px, calc(100% - 28px));
    margin: 0 auto;
    padding: 28px 0 60px;
}

.admin-topbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    margin-bottom: 22px;
}

.admin-topbar h1,
.admin-login-card h1 {
    margin: 0;
    font-family: Georgia, "Times New Roman", serif;
    font-weight: normal;
}

.admin-topbar p {
    margin: 5px 0 0;
    color: #6d655e;
}

.admin-link,
.admin-button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    border: 0;
    border-radius: 9px;
    padding: 9px 13px;
    background: #252525;
    color: #fff;
    text-decoration: none;
    font: 600 13px/1 Arial, sans-serif;
    cursor: pointer;
}

.admin-button.secondary {
    background: #e8dfd2;
    color: #2e2b28;
}

.admin-button.warning {
    background: #72520a;
}

.admin-button.success {
    background: #2f633e;
}

.admin-button.danger {
    background: #9f2d2d;
}

.admin-button:disabled {
    opacity: .55;
    cursor: not-allowed;
}

.admin-notice {
    margin: 0 0 18px;
    padding: 12px 14px;
    border-radius: 10px;
    background: #fff7df;
    border: 1px solid #ead39a;
}

.admin-warning {
    margin: 0 0 18px;
    padding: 12px 14px;
    border-radius: 10px;
    background: #ffe5e5;
    border: 1px solid #e5aaaa;
    color: #771f1f;
}

.admin-post {
    margin-bottom: 22px;
    overflow: hidden;
    border: 1px solid #d8d0c5;
    border-radius: 14px;
    background: #fff;
    box-shadow: 0 4px 18px rgba(0,0,0,.05);
}

.admin-post-head {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 18px;
    padding: 16px;
    border-bottom: 1px solid #eee8df;
}

.admin-post-head h2 {
    margin: 0 0 5px;
    font: 700 18px/1.2 Arial, sans-serif;
}

.admin-post-meta {
    color: #7f766d;
    font-size: 12px;
}

.admin-caption {
    margin: 0;
    padding: 14px 16px 0;
    line-height: 1.45;
}

.admin-media-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 14px;
    padding: 16px;
}

.admin-media-card {
    overflow: hidden;
    border: 1px solid #ddd4c8;
    border-radius: 12px;
    background: #faf8f4;
}

.admin-media-preview {
    position: relative;
    background: #111;
}

.admin-media-preview img,
.admin-media-preview video {
    display: block;
    width: 100%;
    aspect-ratio: 1 / 1;
    object-fit: cover;
}

.admin-media-private-badge {
    position: absolute;
    top: 9px;
    left: 9px;
    z-index: 2;
    padding: 6px 8px;
    border-radius: 999px;
    background: rgba(0,0,0,.8);
    color: #fff;
    font: 700 10px/1 Arial, sans-serif;
    letter-spacing: 1px;
}

.admin-media-info {
    padding: 11px 12px 4px;
    font-size: 12px;
    color: #6f675f;
    overflow-wrap: anywhere;
}

.admin-media-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 7px;
    padding: 9px 12px 12px;
}

.admin-media-actions form,
.admin-post-head form,
.admin-comment-row form,
.admin-login-card form {
    margin: 0;
}

.admin-media-actions form > button,
.admin-post-head form > button,
.admin-comment-row form > button,
.admin-login-card form > button {
    width: auto;
    margin: 0;
}

.admin-comments {
    padding: 0 16px 16px;
}

.admin-comments h3 {
    margin: 4px 0 9px;
    font-size: 14px;
}

.admin-comment-row {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 12px;
    padding: 9px 0;
    border-top: 1px solid #eee8df;
    font-size: 13px;
}

.admin-comment-text {
    flex: 1;
    line-height: 1.4;
}

.admin-empty {
    padding: 42px 20px;
    border: 1px dashed #cfc5b8;
    border-radius: 14px;
    text-align: center;
    background: rgba(255,255,255,.55);
}

.admin-login-wrap {
    min-height: 100vh;
    display: grid;
    place-items: center;
    padding: 24px;
}

.admin-login-card {
    width: min(430px, 100%);
    padding: 28px;
    border: 1px solid #d8d0c5;
    border-radius: 16px;
    background: #fff;
    box-shadow: 0 12px 36px rgba(0,0,0,.09);
}

.admin-login-card p {
    color: #756d65;
}

.admin-login-card label {
    margin-top: 15px;
}

.admin-login-card input {
    font-family: Arial, Helvetica, sans-serif;
}

@media (max-width: 680px) {
    .admin-topbar,
    .admin-post-head,
    .admin-comment-row {
        align-items: stretch;
        flex-direction: column;
    }

    .admin-post-head form > button,
    .admin-comment-row form > button {
        width: 100%;
    }

    .admin-media-grid {
        grid-template-columns: 1fr;
    }
}
