:root {
    --bg: #eef3f8;
    --surface: #ffffff;
    --surface-alt: #f7f9fc;
    --text: #10151c;
    --muted: #5c6877;
    --line: #d9e1eb;
    --line-strong: #c1ccd8;
    --brand: #b5121b;
    --brand-dark: #8d0e15;
    --shadow: 0 24px 60px rgba(16, 21, 28, 0.08);
    --radius-lg: 28px;
    --radius-md: 18px;
}

html[data-theme="dark"] {
    --bg: #0a0f15;
    --surface: #101826;
    --surface-alt: #0f1722;
    --text: #e7edf6;
    --muted: #a8b4c6;
    --line: rgba(231, 237, 246, 0.14);
    --line-strong: rgba(231, 237, 246, 0.22);
    --shadow: 0 24px 60px rgba(0, 0, 0, 0.42);
}

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

body {
    min-height: 100vh;
    color: var(--text);
    font-family: "Segoe UI", Tahoma, Geneva, Verdana, sans-serif;
    background:
        radial-gradient(circle at top left, rgba(181, 18, 27, 0.14), transparent 22%),
        radial-gradient(circle at top right, rgba(10, 102, 194, 0.12), transparent 20%),
        linear-gradient(180deg, #f7f9fc 0%, #edf2f7 100%);
}

html[data-theme="dark"] body {
    background:
        radial-gradient(circle at 16% 10%, rgba(181, 18, 27, 0.22), transparent 36%),
        radial-gradient(circle at 82% 12%, rgba(10, 102, 194, 0.18), transparent 34%),
        linear-gradient(180deg, #070b10 0%, #0b1018 100%);
}

.story-top-actions {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 18px;
}

.story-shell {
    width: min(980px, calc(100% - 24px));
    margin: 0 auto;
    padding: 28px 0 40px;
}

.story-back-link {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 18px;
    padding: 12px 18px;
    border-radius: 999px;
    color: #fff;
    font-weight: 700;
    text-decoration: none;
    background: linear-gradient(135deg, var(--brand), var(--brand-dark));
    box-shadow: 0 14px 28px rgba(181, 18, 27, 0.2);
}

.theme-toggle {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 48px;
    height: 48px;
    padding: 0;
    border: 1px solid var(--line);
    border-radius: 999px;
    color: var(--text);
    font-weight: 800;
    background: var(--surface);
    box-shadow: var(--shadow);
}

.theme-toggle svg {
    width: 20px;
    height: 20px;
}

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

.story-panel {
    padding: 24px;
    border: 1px solid var(--line);
    border-radius: var(--radius-lg);
    background: var(--surface);
    box-shadow: var(--shadow);
}

.story-panel + .story-panel {
    margin-top: 20px;
}

.story-topline {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin-bottom: 18px;
}

.story-chip {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 7px 12px;
    border-radius: 999px;
    color: var(--brand);
    font-size: 0.78rem;
    font-weight: 800;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    background: rgba(181, 18, 27, 0.08);
}

.story-chip-link {
    transition: transform 0.2s ease, background 0.2s ease, color 0.2s ease;
}

.story-chip-link:hover {
    transform: translateY(-1px);
    color: #fff;
    background: linear-gradient(135deg, var(--brand), var(--brand-dark));
}

.story-panel h1,
.section-head h2 {
    font-family: Georgia, "Times New Roman", serif;
}

.story-panel h1 {
    font-size: clamp(2rem, 5vw, 3.7rem);
    line-height: 1.02;
}

.story-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 12px 18px;
    margin-top: 18px;
    color: var(--muted);
    font-weight: 600;
}

.story-hero {
    width: 100%;
    border-radius: 22px;
    aspect-ratio: 4 / 5;
    min-height: 520px;
    object-fit: cover;
}

.story-gallery {
    display: grid;
    gap: 12px;
    margin-top: 24px;
}

.story-video-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 12px;
    margin-top: 22px;
}

.story-video {
    width: 100%;
    border-radius: 18px;
    background: #0b0f17;
    aspect-ratio: 16 / 9;
}

.story-gallery.is-multi {
    grid-template-columns: repeat(2, minmax(0, 1fr));
}

.story-gallery-image {
    width: 100%;
    border-radius: 18px;
    aspect-ratio: 4 / 5;
    min-height: 320px;
    object-fit: cover;
}

.story-body {
    display: grid;
    gap: 16px;
    margin-top: 24px;
    color: var(--text);
    font-size: 1.04rem;
    line-height: 1.8;
}

.story-disclaimer {
    margin-top: 20px;
    padding: 16px 18px;
    border: 1px solid var(--line);
    border-left: 4px solid var(--brand);
    border-radius: 20px;
    background: var(--surface-alt);
}

.story-disclaimer-label {
    display: inline-block;
    font-weight: 800;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    font-size: 0.72rem;
    color: var(--muted);
}

.story-disclaimer p {
    margin: 10px 0 0;
    color: var(--text);
    line-height: 1.7;
}

.story-engagement {
    display: grid;
    gap: 18px;
    margin-top: 28px;
    padding-top: 22px;
    border-top: 1px solid var(--line);
}

.story-engagement-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
}

.story-action-button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 12px 18px;
    border: 1px solid var(--line);
    border-radius: 999px;
    color: var(--text);
    font-weight: 700;
    background: var(--surface);
    cursor: pointer;
    transition: transform 0.2s ease, border-color 0.2s ease, background 0.2s ease;
}

.story-action-button:hover {
    transform: translateY(-2px);
    border-color: var(--line-strong);
}

.story-action-button.is-active {
    color: #fff;
    border-color: transparent;
    background: linear-gradient(135deg, var(--brand), var(--brand-dark));
}

.story-comments-block {
    display: grid;
    gap: 14px;
    padding: 18px;
    border: 1px solid var(--line);
    border-radius: 22px;
    background: var(--surface-alt);
}

.story-comments-list {
    display: grid;
    gap: 12px;
}

.story-comment-item {
    padding: 14px 16px;
    border-radius: 18px;
    background: var(--surface);
    border: 1px solid var(--line);
}

.story-comment-item strong {
    display: block;
    font-size: 0.95rem;
}

.story-comment-item p,
.story-comments-empty {
    margin-top: 6px;
    color: var(--muted);
    line-height: 1.7;
}

.story-comment-form {
    display: grid;
    gap: 12px;
}

.story-comment-form input,
.story-comment-form textarea {
    width: 100%;
    padding: 13px 15px;
    border: 1px solid var(--line);
    border-radius: 16px;
    color: var(--text);
    background: var(--surface);
    outline: none;
    resize: vertical;
}

.story-comment-form textarea {
    min-height: 110px;
}

.story-comment-form input:focus,
.story-comment-form textarea:focus,
.share-link-input:focus {
    border-color: var(--line-strong);
    box-shadow: 0 0 0 4px rgba(10, 102, 194, 0.08);
}

.story-comment-form button {
    justify-self: start;
    padding: 12px 18px;
    border: none;
    border-radius: 999px;
    color: #fff;
    font-weight: 700;
    background: #10151c;
    cursor: pointer;
}

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

.section-chip {
    display: inline-flex;
    margin-bottom: 8px;
    color: var(--brand);
    font-size: 0.78rem;
    font-weight: 800;
    letter-spacing: 0.08em;
    text-transform: uppercase;
}

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

.related-card {
    display: grid;
    gap: 12px;
    color: inherit;
    text-decoration: none;
}

.related-card img {
    width: 100%;
    height: 180px;
    border-radius: var(--radius-md);
    object-fit: cover;
}

.related-card h3 {
    font-size: 1.08rem;
    line-height: 1.35;
}

.related-card p {
    color: var(--muted);
    line-height: 1.6;
}

.story-loading,
.story-empty {
    color: var(--muted);
    font-size: 1rem;
}

.story-footer {
    margin-top: 20px;
    padding: 20px 24px;
    border: 1px solid var(--line);
    border-radius: var(--radius-lg);
    color: var(--muted);
    text-align: center;
    background: var(--surface);
    box-shadow: var(--shadow);
}

.share-modal-open {
    overflow: hidden;
}

.share-modal-overlay {
    position: fixed;
    inset: 0;
    z-index: 90;
    background: rgba(7, 10, 16, 0.66);
    backdrop-filter: blur(6px);
}

.share-modal {
    position: fixed;
    top: 50%;
    left: 50%;
    z-index: 100;
    width: min(680px, calc(100vw - 28px));
    max-height: calc(100vh - 36px);
    overflow-y: auto;
    padding: 28px;
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 28px;
    color: #f5f7fb;
    background:
        radial-gradient(circle at top right, rgba(11, 117, 214, 0.2), transparent 24%),
        radial-gradient(circle at top left, rgba(181, 18, 27, 0.26), transparent 28%),
        linear-gradient(180deg, #0d1320 0%, #121c2b 100%);
    box-shadow: 0 28px 90px rgba(7, 10, 16, 0.45);
    transform: translate(-50%, -50%);
}

.share-modal-close {
    position: absolute;
    top: 18px;
    right: 18px;
    width: 44px;
    height: 44px;
    border: 1px solid rgba(255, 255, 255, 0.12);
    border-radius: 14px;
    background: rgba(255, 255, 255, 0.06);
    cursor: pointer;
}

.share-modal-close span {
    position: absolute;
    top: 21px;
    left: 12px;
    width: 18px;
    height: 2px;
    border-radius: 999px;
    background: #fff;
}

.share-modal-close span:first-child {
    transform: rotate(45deg);
}

.share-modal-close span:last-child {
    transform: rotate(-45deg);
}

.share-modal-kicker {
    color: #8fb8ff;
    font-size: 0.8rem;
    font-weight: 800;
    letter-spacing: 0.12em;
    text-transform: uppercase;
}

.share-modal h2 {
    margin-top: 10px;
    font-family: Georgia, "Times New Roman", serif;
    font-size: clamp(2rem, 4vw, 3rem);
    line-height: 1.02;
}

.share-modal-copy {
    max-width: 46ch;
    margin-top: 14px;
    color: rgba(245, 247, 251, 0.76);
    line-height: 1.7;
}

.share-modal-preview {
    display: grid;
    gap: 10px;
    margin-top: 24px;
    padding: 18px;
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 22px;
    background: rgba(255, 255, 255, 0.06);
}

.share-modal-tag {
    display: inline-flex;
    width: fit-content;
    padding: 7px 12px;
    border-radius: 999px;
    color: #fff;
    font-size: 0.75rem;
    font-weight: 800;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    background: linear-gradient(135deg, rgba(181, 18, 27, 0.95), rgba(10, 102, 194, 0.88));
}

.share-modal-preview h3 {
    font-family: Georgia, "Times New Roman", serif;
    font-size: 1.45rem;
    line-height: 1.25;
}

.share-modal-preview p {
    color: rgba(245, 247, 251, 0.78);
    line-height: 1.7;
}

.share-modal-field {
    display: inline-block;
    margin-top: 22px;
    margin-bottom: 10px;
    color: rgba(245, 247, 251, 0.82);
    font-size: 0.84rem;
    font-weight: 700;
    letter-spacing: 0.06em;
    text-transform: uppercase;
}

.share-link-row {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 12px;
}

.share-link-input {
    width: 100%;
    padding: 14px 16px;
    border: 1px solid rgba(255, 255, 255, 0.14);
    border-radius: 16px;
    color: #fff;
    background: rgba(255, 255, 255, 0.06);
    outline: none;
}

.share-copy-button {
    padding: 14px 18px;
    border: none;
    border-radius: 16px;
    color: #fff;
    font-weight: 700;
    background: linear-gradient(135deg, var(--brand), var(--brand-dark));
    box-shadow: 0 16px 34px rgba(181, 18, 27, 0.28);
    cursor: pointer;
}

.share-network-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 12px;
    margin-top: 18px;
}

.share-network {
    min-height: 58px;
    padding: 14px 16px;
    border: 1px solid transparent;
    border-radius: 18px;
    color: #fff;
    font-weight: 800;
    letter-spacing: 0.02em;
    cursor: pointer;
    transition: transform 0.2s ease, box-shadow 0.2s ease, border-color 0.2s ease;
}

.share-network:hover,
.share-copy-button:hover,
.share-modal-close:hover {
    transform: translateY(-2px);
}

.share-network.whatsapp {
    background: linear-gradient(135deg, #1fb85c, #0c8d44);
    box-shadow: 0 18px 30px rgba(18, 146, 72, 0.24);
}

.share-network.facebook {
    background: linear-gradient(135deg, #1f6feb, #1b74e4);
    box-shadow: 0 18px 30px rgba(27, 116, 228, 0.22);
}

.share-network.x {
    background: linear-gradient(135deg, #0b0e13, #202938);
    box-shadow: 0 18px 30px rgba(7, 10, 16, 0.24);
}

.share-network.instagram {
    background: linear-gradient(135deg, #f58529, #dd2a7b, #8134af);
    box-shadow: 0 18px 30px rgba(221, 42, 123, 0.24);
}

.share-network.native {
    color: #0f1722;
    background: linear-gradient(135deg, #f7d58a, #ffd9a9);
    box-shadow: 0 18px 30px rgba(255, 179, 71, 0.22);
}

.share-modal-status {
    margin-top: 18px;
    color: #a6d3ff;
    line-height: 1.6;
}

.share-modal-status.is-error {
    color: #ffbdbd;
}

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

    .story-video-grid {
        grid-template-columns: 1fr;
    }

    .story-gallery.is-multi {
        grid-template-columns: 1fr;
    }

    .story-panel {
        padding: 20px;
    }

    .share-link-row,
    .share-network-grid {
        grid-template-columns: 1fr;
    }

    .share-copy-button,
    .share-network,
    .story-action-button,
    .story-comment-form button {
        width: 100%;
    }
}
