/* ============================================
   THE DAILY PROPHET — Newspaper Stylesheet
   ============================================ */

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

:root {
    --parchment: #f5e6c8;
    --parchment-dark: #e8d5a8;
    --parchment-darker: #d4bc82;
    --ink: #2a1a0a;
    --ink-light: #4a3520;
    --ink-faded: #6b5540;
    --accent: #8b6914;
    --rule-color: #3a2a1a;
    --frame-color: #5a4530;
    --frame-shadow: #3a2510;
}

html {
    font-size: 16px;
}

body {
    background: #d8cfc4;
    display: flex;
    justify-content: center;
    padding: 2rem 1rem;
    min-height: 100vh;
    position: relative;
}

a {
    color: var(--ink);
    text-decoration: underline;
    text-decoration-color: var(--ink-light);
    text-decoration-thickness: 1px;
    text-underline-offset: 2px;
}

a:visited {
    color: var(--ink-light);
}

a:hover {
    color: var(--accent);
    text-decoration-color: var(--accent);
}

/* -- Parchment Texture (pure CSS) -- */
.newspaper {
    position: relative;
    max-width: 940px;
    width: 100%;
    background: linear-gradient(
        165deg,
        #e2ded6 0%,
        #d8d1c7 25%,
        #cfc6ba 55%,
        #d7d0c6 80%,
        #e0d9cf 100%
    );
    color: var(--ink);
    padding: 1.8rem 2rem;
    box-shadow:
        0 0 0 1px rgba(0, 0, 0, 0.1),
        0 2px 8px rgba(0, 0, 0, 0.2),
        0 8px 24px rgba(0, 0, 0, 0.3),
        inset 0 0 80px rgba(139, 105, 20, 0.1);
    font-family: "Libre Baskerville", "Libre Baskerville", "Georgia", serif;
    line-height: normal;
    overflow: hidden;
}

/* Aged edges */
.newspaper::before {
    content: "";
    position: absolute;
    inset: 0;
    pointer-events: none;
    background:
        linear-gradient(
            to right,
            rgba(90, 60, 20, 0.15) 0%,
            transparent 3%,
            transparent 97%,
            rgba(90, 60, 20, 0.15) 100%
        ),
        linear-gradient(
            to bottom,
            rgba(90, 60, 20, 0.1) 0%,
            transparent 2%,
            transparent 98%,
            rgba(90, 60, 20, 0.12) 100%
        );
    z-index: 10;
}

/* ============================================
   MASTHEAD
   ============================================ */
.masthead {
    text-align: center;
}

.masthead-title {
    font:
        900 5rem "Playfair Display",
        "Georgia",
        serif;
    color: var(--ink);
    line-height: 1;
    text-transform: uppercase;
    margin: 0.3rem 0;
    width: 100%;
    display: block;
    text-shadow: 0 1px 0 rgba(0, 0, 0, 0.12);
}

.masthead-top-row,
.masthead-sub-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-family: "Libre Baskerville", "Georgia", serif;
    font-size: 0.92rem;
    color: var(--ink-light);
    padding: 0 0.5rem;
}

.masthead-sub-row {
    margin-top: 0.2rem;
}

.masthead-date {
    font-style: italic;
    font-size: 1rem;
}

.masthead-info {
    font-style: italic;
}

/* Ornament dividers */
.masthead-ornament {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    margin: 0.3rem 0;
}

.ornament-line {
    flex: 1;
    height: 2px;
    background: linear-gradient(
        to right,
        transparent,
        var(--rule-color),
        transparent
    );
}

.ornament-line.short {
    max-width: 60px;
}

.ornament-diamond {
    color: var(--rule-color);
    font-size: 0.7rem;
    line-height: normal;
}

.ornament-diamond.small {
    font-size: 0.55rem;
}

.bottom-ornament .ornament-line {
    height: 3px;
    background: linear-gradient(
        to right,
        transparent,
        var(--ink) 15%,
        var(--ink) 85%,
        transparent
    );
}

/* ============================================
   HEADLINE
   ============================================ */
.headline-section {
    text-align: center;
    padding: 0.5rem 1rem 0.7rem;
    border-bottom: 1px solid var(--rule-color);
    margin-bottom: 0.8rem;
}

.headline {
    font-family: "Georgia", serif;
    font-size: 2.5rem;
    font-weight: 500;
    line-height: normal;
    letter-spacing: 0.02em;
    color: var(--ink);
    margin-bottom: 0.35rem;
    text-transform: uppercase;
}

.headline-subtitle {
    font-family: "IM Fell English", serif;
    font-size: 1.2rem;
    font-style: italic;
    color: var(--ink-light);
    line-height: normal;
}

/* ============================================
   CONTENT GRID
   ============================================ */
.content-grid {
    display: grid;
    grid-template-columns: 1fr 260px;
    grid-template-rows: auto auto;
    gap: 0;
}

.main-story {
    grid-column: 1;
    grid-row: 1;
    padding-right: 1rem;
    border-right: 2px solid var(--rule-color);
}

.sidebar {
    grid-column: 2;
    grid-row: 1;
    padding-left: 1rem;
}

.bottom-row {
    grid-column: 1 / -1;
    grid-row: 2;
    display: flex;
    gap: 1.5rem;
    align-items: flex-start;
    border-top: 3px double var(--rule-color);
    margin-top: 1rem;
    padding-top: 0.8rem;
}

.bottom-row .bottom-story {
    flex: 1;
    padding: 0 0.7rem;
}

.bottom-row .bottom-story:not(:last-child) {
    border-right: 1px solid var(--rule-color);
}

.bottom-row .bottom-story:first-child {
    padding-left: 0;
}

.bottom-row .bottom-story:last-child {
    padding-right: 0;
}

/* Bottom row inside main story needs more space */
.main-story .bottom-row {
    gap: 1.8rem;
}

.main-story .bottom-row .bottom-story {
    padding: 0;
}

.main-story .bottom-row .bottom-story:not(:last-child) {
    border-right: none;
}

/* ============================================
   TYPOGRAPHY
   ============================================ */
.story-text p,
.sidebar-story p,
.bottom-story p {
    font-size: 0.9rem;
    line-height: normal;
    margin-bottom: 0.38rem;
    color: var(--ink);
    text-align: justify;
    hyphens: auto;
}

.drop-cap::first-letter {
    font-family: "Playfair Display", serif;
    font-size: 4.1rem;
    font-weight: 900;
    float: left;
    line-height: 0.5;
    margin: 0.1em 0.12em -0.05em 0;
    padding: 0;
    color: var(--ink);
}

.sidebar-headline,
.bottom-headline {
    font-family: "Playfair Display", serif;
    font-size: 1.12rem;
    font-weight: 700;
    line-height: normal;
    margin-bottom: 0.4rem;
    color: var(--ink);
    text-transform: uppercase;
    letter-spacing: 0.01em;
}

.sidebar-headline {
    font-size: 1.16rem;
}

/* ============================================
   IMAGE FRAMES
   ============================================ */
.image-frame {
    margin-bottom: 0.5rem;
    border: 1px solid var(--rule-color);
    overflow: hidden;
}

.image {
    width: 100%;
    height: 0;
    padding-bottom: 65%;
    background-size: cover;
    background-position: center;
    position: relative;
    overflow: hidden;
    filter: sepia(40%) contrast(1.1) brightness(0.95);
}

.image-caption {
    font-family: "IM Fell English", serif;
    font-size: 0.88rem;
    font-style: italic;
    color: var(--ink-faded);
    margin-top: 0.4rem;
    line-height: normal;
    text-align: center;
}

.featured-frame .image {
    padding-bottom: 55%;
}

.small-frame .image {
    padding-bottom: 70%;
}

.frame-tall .image {
    padding-bottom: 85%;
}

.frame-wide .image {
    padding-bottom: 60%;
}

.frame-full-height .image {
    padding-bottom: 100%;
}

.bottom-story-large {
    flex: 1.3;
    align-self: flex-start;
}

.bottom-story-offset {
    flex: 1;
    margin-top: 2.5rem;
}

/* ============================================
   SIDEBAR DIVIDER
   ============================================ */
.sidebar-divider {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    margin: 1.2rem 0;
}

/* ============================================
   ADVERTISEMENTS / FOOTER
   ============================================ */
.newspaper-footer {
    margin-top: 1rem;
}

.footer-ornament {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin-bottom: 1rem;
}

.footer-ornament .ornament-line {
    height: 2px;
    background: linear-gradient(
        to right,
        transparent,
        var(--ink) 20%,
        var(--ink) 80%,
        transparent
    );
}

.adverts-row {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 0.6rem;
    margin-bottom: 1rem;
}

.advert {
    text-align: center;
}

.advert-border {
    border: 2px solid var(--rule-color);
    padding: 0.5rem 0.4rem;
    position: relative;
}

.advert-border::before {
    content: "";
    position: absolute;
    inset: 3px;
    border: 1px solid var(--rule-color);
    pointer-events: none;
}

.advert h4 {
    font-family: "Playfair Display", serif;
    font-size: 0.94rem;
    font-weight: 900;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    margin-bottom: 0.3rem;
    color: var(--ink);
}

.advert p {
    font-family: "IM Fell English", serif;
    font-size: 0.84rem;
    color: var(--ink-light);
    line-height: normal;
    margin-bottom: 0.2rem;
}

.advert-small {
    font-size: 0.76rem !important;
    color: var(--ink-faded) !important;
}

.confirm-attendance-btn {
    display: inline-block;
    margin-top: 0.35rem;
    padding: 0.3rem 0.55rem;
    border: 1px solid var(--rule-color);
    color: var(--ink);
    background: linear-gradient(
        to bottom,
        rgba(245, 230, 200, 0.9),
        rgba(232, 213, 168, 0.9)
    );
    font-family: "Playfair Display", "Georgia", serif;
    font-size: 0.8rem;
    font-weight: 700;
    letter-spacing: 0.03em;
    text-transform: uppercase;
    text-decoration: none;
}

.confirm-attendance-btn:hover {
    background: linear-gradient(
        to bottom,
        rgba(232, 213, 168, 0.95),
        rgba(212, 188, 130, 0.95)
    );
}

.rsvp-button,
.calendar-button {
    display: block;
    margin-top: 0.8rem;
    padding: 0.6rem 1rem;
    border: 2px solid var(--rule-color);
    color: var(--ink);
    background: transparent;
    font-family: "Playfair Display", "Georgia", serif;
    font-size: 0.9rem;
    font-weight: 700;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    text-align: center;
    cursor: pointer;
    position: relative;
}

.rsvp-button::before {
    content: "";
    position: absolute;
    inset: 4px;
    border: 1px solid var(--rule-color);
    pointer-events: none;
}

.rsvp-button:hover,
.calendar-button:hover {
    background: rgba(42, 26, 10, 0.03);
}

/* ============================================
   MODAL STYLES
   ============================================ */
.modal {
    display: none;
    position: fixed;
    inset: 0;
    z-index: 1000;
    align-items: center;
    justify-content: center;
    padding: 1rem;
}

.modal.active {
    display: flex;
}

.modal-overlay {
    position: absolute;
    inset: 0;
    background: rgba(42, 26, 10, 0.75);
    backdrop-filter: blur(3px);
}

.modal-content {
    position: relative;
    background: var(--parchment);
    border: 3px solid var(--rule-color);
    box-shadow:
        0 0 0 1px var(--parchment-dark) inset,
        0 8px 30px rgba(42, 26, 10, 0.5),
        0 0 200px rgba(42, 26, 10, 0.3);
    max-width: 600px;
    width: 100%;
    max-height: 90vh;
    overflow-y: auto;
    padding: 2rem;
    z-index: 1001;
}

.modal-header {
    text-align: center;
    margin-bottom: 1.5rem;
    position: relative;
    padding-bottom: 1rem;
    border-bottom: 2px solid var(--rule-color);
}

.modal-title {
    font-family: "Playfair Display", "Georgia", serif;
    font-size: 3.3rem;
    font-weight: 900;
    color: var(--ink);
    letter-spacing: 0.05em;
    text-transform: uppercase;
    margin: 0.5rem 0;
}

.modal-subtitle {
    font-family: "IM Fell English", serif;
    font-size: 1.05rem;
    color: var(--ink-light);
    font-style: italic;
    margin-top: 0.3rem;
}

.modal-close {
    position: absolute;
    top: -0.5rem;
    right: 0;
    background: transparent;
    border: none;
    font-size: 2.5rem;
    line-height: 1;
    color: var(--ink-light);
    cursor: pointer;
    padding: 0;
    width: 35px;
    height: 35px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: color 0.2s ease;
}

.modal-close:hover {
    color: var(--ink);
}

/* ============================================
   FORM STYLES
   ============================================ */
.rsvp-form {
    margin-top: 1.5rem;
}

.form-group {
    margin-bottom: 1.3rem;
}

.form-group label {
    display: block;
    font-family: "Playfair Display", "Georgia", serif;
    font-size: 1.05rem;
    font-weight: 700;
    color: var(--ink);
    margin-bottom: 0.5rem;
    letter-spacing: 0.02em;
}

.required {
    color: var(--accent);
    font-weight: 700;
}

.optional {
    font-family: "IM Fell English", serif;
    font-size: 0.95rem;
    font-weight: 400;
    color: var(--ink-faded);
    font-style: italic;
}

.badge {
    display: inline-block;
    font-family: "IM Fell English", serif;
    font-size: 0.85rem;
    font-weight: 400;
    color: var(--ink-faded);
    background: var(--parchment-dark);
    border: 1px solid var(--rule-color);
    padding: 0.15rem 0.4rem;
    margin-left: 0.3rem;
    font-style: italic;
}

.form-group input[type="text"],
.form-group input[type="email"],
.form-group input[type="tel"],
.form-group textarea {
    width: 100%;
    padding: 0.65rem 0.8rem;
    border: 2px solid var(--rule-color);
    background: rgba(255, 255, 255, 0.4);
    font-family: "Libre Baskerville", serif;
    font-size: 1rem;
    color: var(--ink);
    transition: all 0.2s ease;
}

.form-group input::placeholder,
.form-group textarea::placeholder {
    color: var(--ink-faded);
    font-style: italic;
    opacity: 0.7;
}

.form-group input:focus,
.form-group textarea:focus {
    outline: none;
    background: rgba(255, 255, 255, 0.6);
    border-color: var(--ink);
    box-shadow: 0 0 0 3px rgba(42, 26, 10, 0.1);
}

.form-group textarea {
    resize: vertical;
    min-height: 70px;
}

/* Radio buttons */
.radio-group {
    display: flex;
    flex-direction: column;
    gap: 0.6rem;
}

.radio-label {
    display: flex;
    align-items: center;
    cursor: pointer;
    font-family: "Libre Baskerville", serif;
    font-size: 1rem;
    color: var(--ink);
    padding: 0.5rem 0.7rem;
    border: 2px solid transparent;
    transition: all 0.2s ease;
    position: relative;
}

.radio-label:hover {
    background: rgba(42, 26, 10, 0.03);
    border-color: var(--parchment-darker);
}

.radio-label input[type="radio"] {
    position: absolute;
    opacity: 0;
    cursor: pointer;
}

.radio-custom {
    width: 20px;
    height: 20px;
    border: 2px solid var(--rule-color);
    border-radius: 50%;
    margin-right: 0.7rem;
    position: relative;
    flex-shrink: 0;
    background: rgba(255, 255, 255, 0.4);
}

.radio-label input[type="radio"]:checked ~ .radio-custom::after {
    content: "";
    position: absolute;
    width: 10px;
    height: 10px;
    background: var(--ink);
    border-radius: 50%;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
}

.radio-label input[type="radio"]:checked ~ .radio-text {
    font-weight: 700;
}

/* Conditional fields */
.conditional-fields {
    max-height: 0;
    overflow: hidden;
    opacity: 0;
    transition:
        max-height 0.4s ease,
        opacity 0.3s ease,
        margin 0.4s ease;
    margin-top: 0;
}

.conditional-fields.visible {
    max-height: 2000px;
    opacity: 1;
    margin-top: 0.5rem;
}

/* Form actions */
.form-actions {
    display: flex;
    gap: 1rem;
    margin-top: 2rem;
    padding-top: 1.5rem;
    border-top: 2px solid var(--rule-color);
}

.submit-button,
.cancel-button {
    flex: 1;
    padding: 0.8rem 1.5rem;
    border: 2px solid var(--rule-color);
    font-family: "Playfair Display", "Georgia", serif;
    font-size: 1.05rem;
    font-weight: 700;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    cursor: pointer;
    position: relative;
    transition: all 0.2s ease;
}

.submit-button {
    background: var(--ink);
    color: var(--parchment);
}

.submit-button::before {
    content: "";
    position: absolute;
    inset: 4px;
    border: 1px solid var(--parchment-dark);
    pointer-events: none;
}

.submit-button:hover {
    background: var(--ink-light);
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(42, 26, 10, 0.3);
}

.cancel-button {
    background: transparent;
    color: var(--ink);
}

.cancel-button:hover {
    background: rgba(42, 26, 10, 0.05);
}

/* Mobile responsive */
@media (max-width: 640px) {
    .modal-content {
        padding: 1.5rem;
        margin: 0.5rem;
    }

    .modal-title {
        font-size: 2.7rem;
    }

    .form-actions {
        flex-direction: column;
    }

    .radio-group {
        gap: 0.4rem;
    }
}

.footer-bottom {
    text-align: center;
    padding-top: 0.8rem;
    border-top: 1px solid var(--rule-color);
}

.footer-bottom p {
    font-family: "IM Fell English", serif;
    font-size: 0.82rem;
    color: var(--ink-faded);
    font-style: italic;
}

/* ============================================
   RESPONSIVE — MOBILE (single column, full width)
   ============================================ */
@media (max-width: 820px) {
    body {
        padding: 0;
    }

    .newspaper {
        padding: 1rem 0.8rem;
        max-width: 100%;
        border-radius: 0;
        box-shadow: none;
    }

    .masthead-title {
        font-size: 4rem;
        font-weight: 900;
    }

    .masthead-top-row,
    .masthead-sub-row {
        flex-direction: column;
        gap: 0.15rem;
        padding: 0;
        font-size: 1rem;
    }

    .masthead-date {
        font-size: 1.05rem;
    }

    .masthead-ornament {
        margin: 0.2rem 0;
    }

    /* Headline */
    .headline-section {
        padding: 0.4rem 0 0.6rem;
        margin-bottom: 0.6rem;
    }

    .headline {
        font-size: 1.85rem;
        margin-bottom: 0.3rem;
    }

    .headline-subtitle {
        font-size: 1.1rem;
    }

    /* Content — single full-width column */
    .content-grid {
        display: flex;
        flex-direction: column;
    }

    .main-story {
        border-right: none;
        padding-right: 0;
        border-bottom: 2px solid var(--rule-color);
        padding-bottom: 0.8rem;
        margin-bottom: 0.8rem;
    }

    .sidebar {
        padding-left: 0;
    }

    .story-text p,
    .sidebar-story p,
    .bottom-story p {
        font-size: 1.08rem;
        line-height: normal;
        text-align: left;
        hyphens: none;
    }

    .drop-cap::first-letter {
        font-size: 3.4rem;
    }

    .sidebar-headline,
    .bottom-headline {
        font-size: 1.22rem;
    }

    /* Bottom stories — single column */
    .bottom-row {
        display: flex;
        flex-direction: column;
        margin-top: 0.8rem;
        padding-top: 0.6rem;
    }

    .bottom-row .bottom-story {
        padding: 0 !important;
        border-right: none !important;
        border-bottom: 1px solid var(--rule-color);
        padding-bottom: 0.8rem !important;
    }

    .bottom-row .bottom-story:last-child {
        border-bottom: none;
        margin-bottom: 0;
        padding-bottom: 0 !important;
    }

    /* Images — full width */
    .featured-frame .image {
        padding-bottom: 56%;
    }

    .small-frame .image {
        padding-bottom: 50%;
    }

    .frame-full-height .image {
        padding-bottom: 100%;
    }

    .image-caption {
        font-size: 1rem;
    }

    /* Ads — single column */
    .adverts-row {
        display: flex;
        flex-direction: column;
        gap: 0.5rem;
    }

    .advert-border {
        padding: 0.5rem 0.4rem;
    }

    .advert h4 {
        font-size: 0.9rem;
        letter-spacing: 0.05em;
    }

    .advert p {
        font-size: 0.84rem;
    }

    .advert-small {
        font-size: 0.76rem !important;
    }

    .confirm-attendance-btn {
        font-size: 0.76rem;
    }

    .rsvp-button {
        font-size: 1.05rem;
        padding: 0.7rem 1.2rem;
    }

    /* Footer */
    .newspaper-footer {
        margin-top: 0.8rem;
    }

    .footer-bottom p {
        font-size: 0.78rem;
    }

    /* Sidebar divider */
    .sidebar-divider {
        margin: 0.8rem 0;
    }
}

/* ============================================
   RESPONSIVE — VERY SMALL PHONES
   ============================================ */
@media (max-width: 380px) {
    .newspaper {
        padding: 0.8rem 0.6rem;
    }

    .masthead-title {
        font-size: clamp(2.1rem, 9vw, 2.9rem);
        letter-spacing: 0;
    }

    .headline {
        font-size: 1.5rem;
    }

    .headline-subtitle {
        font-size: 1rem;
    }

    .story-text p,
    .sidebar-story p,
    .bottom-story p {
        font-size: 1.05rem;
    }
}

/* ============================================
   PRINT STYLES (because wizards print too)
   ============================================ */
@media print {
    body {
        background: white;
        padding: 0;
    }

    .newspaper {
        box-shadow: none;
        max-width: 100%;
    }

    .image {
        filter: grayscale(100%);
    }
}
