/* Fonts */
@font-face {
    font-family: "AuthenticSerif";
    src: url("fonts/authentic-serif-webfonts-260409/AuthenticSerif-70.woff2")
        format("woff2");
    font-weight: 70;
}

@font-face {
    font-family: "AuthenticSerif";
    src: url("fonts/authentic-serif-webfonts-260409/AuthenticSerifItalic-70.woff2")
        format("woff2");
    font-weight: 70;
    font-style: italic;
}

@font-face {
    font-family: "AuthenticSans";
    src: url("fonts/authentic-sans-pro-130.woff2") format("woff2");
    font-weight: 130;
}

@font-face {
    font-family: "AuthenticSerif";
    src: url("fonts/authentic-serif-webfonts-260409/AuthenticSerif-40.woff2")
        format("woff2");
    font-weight: 40;
}

@font-face {
    font-family: "AuthenticSerif";
    src: url("fonts/authentic-serif-webfonts-260409/AuthenticSerifItalic-40.woff2")
        format("woff2");
    font-weight: 40;
    font-style: italic;
}

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

/* Variables */
:root {
    --color-black: #000000;
    --color-white: #ffffff;
    --color-gray: #999999;
    --font-serif: "AuthenticSerif", Georgia, serif;
    --font-sans: "AuthenticSans", Helvetica, Arial, sans-serif;
    --page-padding: 80px;
    --label-width: 140px;
    --label-gap: 40px;
}

/* Base */
html {
    font-size: 16px;
}

body {
    font-family: var(--font-serif);
    line-height: 1.5;
    color: var(--color-black);
    background-color: var(--color-white);
}

a {
    color: inherit;
}

/* Header */
.site-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    padding: 50px var(--page-padding);
    padding-bottom: 104px;
}

.hamburger {
    display: none;
}

.nav-link {
    font-family: var(--font-sans);
    font-size: 10px;
    letter-spacing: 0.1em;
    text-decoration: none;
    text-transform: uppercase;
    color: var(--color-black);
    padding-top: 10px;
}

.site-title {
    flex: 1;
    text-align: center;
}

.site-title img {
    width: 338px;
    height: auto;
    display: block;
    margin: 0 auto;
}

.site-header a {
    text-decoration: none;
    color: inherit;
}

/* Panels */
.panels {
    padding: 0 var(--page-padding);
}

.panel {
    border-top: none;
}

.panel:first-child > .panel-row {
    padding-top: 0;
}

.panel:last-child {
    border-bottom: none;
}

/* Panel Row */
.panel-row {
    display: flex;
    flex-wrap: wrap;
    align-items: baseline;
    gap: 0 var(--label-gap);
    padding: 23px 0;
    cursor: pointer;
}

.panel-label {
    font-family: var(--font-sans);
    font-size: 10px;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    flex-shrink: 0;
    width: var(--label-width);
}

.panel-title {
    font-family: var(--font-serif);
    font-size: 18px;
    line-height: 1.4;
}

/* Panel Content (expandable) */
.panel-content {
    display: grid;
    grid-template-rows: 0fr;
    transition: grid-template-rows 0.4s ease;
}

.panel.is-open .panel-content {
    grid-template-rows: 1fr;
}

.panel-content-inner {
    overflow: hidden;
}

/* Panel Body */
.panel-body {
    padding: 19px 0 20px;
    padding-left: calc(var(--label-width) + var(--label-gap));
    max-width: none;
}

/* Magazine expanded */
.panel-body--magazine {
    display: flex;
    gap: 60px;
    max-width: none;
    padding-top: 19px;
    padding-left: calc(var(--label-width) + var(--label-gap));
}

.magazine-text {
    flex: 1;
    max-width: 644px;
    font-size: 18px;
    line-height: 1.5;
}

.magazine-text p + p {
    margin-top: 1em;
}

/* Epigraph */
.panel-body--epigraph {
    max-width: none;
}

.epigraph-text {
    max-width: 644px;
    font-size: 18px;
    line-height: 1.5;
}

.epigraph-text p + p {
    margin-top: 1em;
}

.magazine-cover {
    display: flex;
    flex-direction: column;
    align-items: center;
    flex-shrink: 0;
    max-width: 285px;
}

.cover-image {
    width: 285px;
    height: auto;
    display: block;
}

.cover-info {
    text-align: center;
    margin-top: 12px;
    font-family: var(--font-serif);
    font-size: 18px;
    max-width: 285px;
}

.cover-caption {
    font-family: var(--font-sans);
    font-size: 10px;
    letter-spacing: 0.1em;
    text-align: center;
    text-transform: uppercase;
    margin-top: 12px;
}

.cover-issue {
    display: block;
}

.cover-pricing {
    display: flex;
    justify-content: center;
    align-items: baseline;
    gap: 8px;
}

.cover-discount-label {
    font-family: var(--font-sans);
    font-size: 10px;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    margin-top: 4px;
}

.cover-price-original {
    font-size: 16px;
    text-decoration: line-through;
    color: var(--color-gray);
}

.cover-price {
    display: block;
}

/* Button */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-family: var(--font-sans);
    font-size: 10px;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    text-decoration: none;
    padding: 10px 20px 10px;
    line-height: 1;
    vertical-align: middle;
    cursor: pointer;
    border: none;
}

.btn--filled {
    background-color: #fab53a;
    color: var(--color-black);
    margin-top: 12px;
    border-radius: 10px;
}

/* Gutter sections — pull label into the gutter created by panel-body padding-left */
.gutter-section {
    display: flex;
    align-items: baseline;
    gap: var(--label-gap);
    margin-top: 83px;
    margin-left: calc(-1 * (var(--label-width) + var(--label-gap)));
}

.gutter-section-label {
    font-family: var(--font-sans);
    font-size: 10px;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    font-weight: 400;
    width: var(--label-width);
    flex-shrink: 0;
}

/* Masthead */
.masthead {
    margin-top: 40px;
}

.masthead-list {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.masthead-entry {
    display: flex;
    gap: 16px;
    align-items: baseline;
}

.masthead-entry dt {
    font-family: var(--font-sans);
    font-size: 10px;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    width: 120px;
    flex-shrink: 0;
}

.masthead-entry dd {
    font-family: var(--font-serif);
    font-size: 18px;
}

/* Contributors list */
.contributors-list {
    font-family: var(--font-serif);
    font-size: 18px;
    line-height: 1.5;
}

/* Close button */
.close-btn {
    display: block;
    margin: 50px auto 20px;
    background: #fab53a;
    border: none;
    border-radius: 10px;
    font-family: var(--font-sans);
    font-size: 10px;
    letter-spacing: 0.1em;
    cursor: pointer;
    color: var(--color-black);
    padding: 10px 20px;
}

.close-btn:hover {
    opacity: 0.8;
}

/* Event panels */
.panel-body--event {
    max-width: none;
}

.event-meta,
.event-description,
.event-image-gallery {
    max-width: 644px;
}

.event-quote {
    max-width: 1053px;
}

.panel-meta {
    flex-basis: 100%;
    padding-left: calc(var(--label-width) + var(--label-gap));
    display: grid;
    grid-template-rows: 0fr;
    transition: grid-template-rows 0.4s ease;
}

.panel-meta-inner {
    overflow: hidden;
}

.panel.is-open .panel-meta {
    grid-template-rows: 1fr;
}

.event-location {
    font-size: 18px;
}

.event-hosts {
    font-size: 18px;
}

.event-hosts a {
    text-decoration: underline;
}

.event-image-gallery {
    position: relative;
    margin-bottom: 30px;
}

.event-image-gallery img {
    width: 100%;
    max-width: 500px;
    height: auto;
    display: block;
}

.image-counter {
    position: absolute;
    top: 8px;
    right: 8px;
    font-family: var(--font-sans);
    font-size: 10px;
    color: var(--color-black);
}

/* Event quote */
.event-quote {
    margin: 30px 0 72px;
    max-width: 1053px;
    font-family: var(--font-serif);
    font-weight: 40;
    font-size: 45px;
    line-height: 1.2;
}

.event-quote p {
    margin-bottom: 8px;
    text-indent: -0.45em;
}

.event-quote cite {
    display: block;
    font-family: var(--font-sans);
    font-size: 10px;
    letter-spacing: 0.1em;
    font-style: normal;
    margin-top: 8px;
}

/* Event description */
.event-description {
    font-size: 18px;
    line-height: 1.5;
}

.event-description p + p {
    margin-top: 1em;
}

.event-description h4 {
    font-weight: 400;
    margin-top: 1.5em;
    margin-bottom: 0.5em;
}

.event-description h4 a {
    color: inherit;
}

/* Patterns section — uses .gutter-section for label placement */

.patterns-list {
    list-style: none;
    font-size: 18px;
    line-height: 1.5;
}

.patterns-list li {
    margin-bottom: 2px;
}

/* Ephemera */
.panel-body--ephemera {
    max-width: none;
}

.ephemera-images {
    display: flex;
    gap: 24px;
    flex-wrap: wrap;
    max-width: 644px;
}

.ephemera-images img {
    max-width: 100%;
    height: auto;
    border: 1px solid var(--color-black);
}

/* PDF thumbnails */
.pdf-thumbnail {
    border: 1px solid var(--color-black);
}

/* Footer */
.site-footer {
    display: grid;
    grid-template-columns: 1fr auto 1fr;
    align-items: baseline;
    padding: 123px var(--page-padding) 114px;
    gap: 40px;
}

.footer-address {
    font-family: var(--font-sans);
    font-size: 10px;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    line-height: 27px;
}

.footer-address address {
    font-style: normal;
}

.footer-email {
    margin-top: 27px;
}

.footer-logo {
    display: flex;
    align-items: center;
    justify-content: center;
    align-self: start;
}

.footer-logo img {
    width: 80px;
    height: 80px;
}

.footer-newsletter {
    justify-self: end;
}

.newsletter-heading {
    font-family: var(--font-sans);
    font-size: 10px;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    line-height: 27px;
    margin-bottom: 12px;
}

.newsletter-form {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.newsletter-email {
    font-family: var(--font-sans);
    font-size: 10px;
    letter-spacing: 0.05em;
    padding: 12px 14px 10px;
    border: 1px solid var(--color-black);
    width: 280px;
    background: transparent;
    border-radius: 10px;
}

.newsletter-email::placeholder {
    color: var(--color-gray);
}

.newsletter-submit {
    align-self: flex-start;
}

/* Mobile Menu */
.mobile-menu {
    display: none;
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    background-color: #f5f4eb;
    color: var(--color-black);
    z-index: 100;
    flex-direction: column;
    align-items: center;
    padding: 24px 24px 30px;
    box-shadow: 0 8px 24px rgba(245, 244, 235, 0.9);
}

/* Sticky mobile header */
.sticky-header {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 90;
    background-color: var(--color-white);
    padding: 0 var(--page-padding);
    height: 68px;
    align-items: flex-start;
    justify-content: space-between;
    padding-top: 16px;
    box-shadow: 0 4px 16px rgba(255, 255, 255, 0.9);
}

.sticky-header.is-visible {
    display: flex;
}

.sticky-header .sticky-hamburger {
    display: flex;
    flex-direction: column;
    gap: 5px;
    background: none;
    border: none;
    cursor: pointer;
    padding: 0;
}

.sticky-header .sticky-hamburger span {
    display: block;
    width: 22px;
    height: 1.5px;
    background-color: var(--color-black);
}

.sticky-header .sticky-logo {
    width: 36px;
    height: 36px;
    position: absolute;
    top: 12px;
    left: 50%;
    transform: translateX(-50%);
}

.mobile-menu.is-open {
    display: flex;
    position: fixed;
}

.mobile-menu-close {
    position: absolute;
    top: 24px;
    left: 24px;
    background: none;
    border: none;
    color: var(--color-black);
    font-family: var(--font-sans);
    font-size: 10px;
    letter-spacing: 0.1em;
    cursor: pointer;
}

.mobile-menu-logo {
    width: 36px;
    height: 36px;
    margin-top: 10px;
}

.mobile-menu-nav {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 12px;
    margin-top: 24px;
}

.mobile-menu-nav a {
    font-family: var(--font-sans);
    font-size: 10px;
    letter-spacing: 0.1em;
    text-decoration: none;
    color: var(--color-black);
}

/* About page */
.about-page {
    padding: 0 var(--page-padding);
}

.about-section {
    border-top: none;
    padding: 40px 0;
}

.about-section:first-child {
    padding-top: 0;
}

.about-row {
    display: flex;
    align-items: baseline;
    gap: var(--label-gap);
}

.about-label {
    font-family: var(--font-sans);
    font-size: 10px;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    width: var(--label-width);
    flex-shrink: 0;
}

.about-content {
    flex: 1;
    max-width: 644px;
    font-size: 18px;
    line-height: 1.5;
}

.about-content p + p {
    margin-top: 1em;
}

/* Advisory Board grid */
.advisory-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 30px 60px;
}

.advisory-name {
    font-family: var(--font-serif);
    font-size: 18px;
    margin-bottom: 4px;
}

.advisory-role {
    font-family: var(--font-sans);
    font-size: 10px;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    line-height: 1.8;
    color: var(--color-black);
}

/* Shop page */
.shop-page {
    padding: 0 var(--page-padding);
}

.shop-section {
    padding: 40px 0;
}

.shop-row {
    display: flex;
    gap: var(--label-gap);
}

.shop-label {
    font-family: var(--font-sans);
    font-size: 10px;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    width: var(--label-width);
    flex-shrink: 0;
    line-height: 1.6;
}

.shop-grid {
    flex: 1;
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 40px;
}

.shop-card {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
}

.shop-card-image {
    width: 285px;
    height: auto;
    display: block;
    margin-bottom: 16px;
}

.shop-card-title {
    font-family: var(--font-serif);
    font-size: 18px;
    font-weight: 400;
    margin-bottom: 4px;
}

.shop-card-subtitle {
    font-family: var(--font-sans);
    font-size: 10px;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: var(--color-gray);
    margin-bottom: 4px;
}

.shop-card-discount-label {
    font-family: var(--font-sans);
    font-size: 10px;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    margin-bottom: 4px;
}

.shop-card-pricing {
    display: flex;
    align-items: baseline;
    gap: 8px;
    margin-bottom: 4px;
}

.shop-card-expected {
    font-family: var(--font-serif);
    font-size: 14px;
    font-style: italic;
    color: var(--color-gray);
    margin-bottom: 16px;
}

.shop-price-original {
    font-family: var(--font-serif);
    font-size: 16px;
    text-decoration: line-through;
    color: var(--color-gray);
}

.shop-price-sale {
    font-family: var(--font-serif);
    font-size: 18px;
}

/* Responsive */
@media (max-width: 900px) {
    :root {
        --page-padding: 24px;
        --label-width: 100px;
        --label-gap: 20px;
    }

    .site-title img {
        width: 338px;
    }
}

@media (max-width: 700px) {
    .nav-link {
        display: none;
    }

    .hamburger {
        display: flex;
        flex-direction: column;
        gap: 5px;
        background: none;
        border: none;
        cursor: pointer;
        padding: 10px 0;
        z-index: 10;
    }

    .hamburger span {
        display: block;
        width: 22px;
        height: 1.5px;
        background-color: var(--color-black);
    }

    .site-header {
        flex-direction: column;
        align-items: flex-start;
        padding: 20px var(--page-padding);
        padding-bottom: 30px;
    }

    .site-title {
        width: 100%;
        text-align: left;
        margin-top: 24px;
    }

    .site-title img {
        width: 100%;
    }

    /* Stack panels vertically */
    .panel-row {
        flex-direction: column;
        gap: 4px;
        padding: 24px 0;
    }

    .panel-label {
        width: auto;
    }

    .panel-title {
        font-size: 18px;
    }

    .panel-body {
        padding-left: 0;
        padding-top: 0;
    }

    .panel-meta {
        padding-left: 0;
        margin-top: -4px;
    }

    .gutter-section {
        flex-direction: column;
        gap: 16px;
        margin-left: 0;
    }

    .gutter-section-label {
        width: auto;
    }

    .panel-body--magazine {
        flex-direction: column;
        padding-left: 0;
    }

    .magazine-cover {
        order: -1;
        align-self: center;
    }

    .cover-image {
        width: 260px;
    }

    .magazine-text {
        max-width: none;
    }

    /* Masthead on mobile: name above role */
    .masthead-entry {
        flex-direction: column;
        gap: 0;
        margin-bottom: 12px;
    }

    .masthead-entry dd {
        font-size: 18px;
    }

    .masthead-entry dt {
        width: auto;
        order: 2;
    }

    /* About page mobile */
    .about-row {
        flex-direction: column;
        gap: 12px;
    }

    .about-label {
        width: auto;
        text-align: center;
    }

    .advisory-grid {
        grid-template-columns: 1fr;
    }

    /* Footer stacked */
    .site-footer {
        grid-template-columns: minmax(0, 1fr);
        padding: 60px var(--page-padding) 40px;
    }

    .footer-logo {
        order: -1;
        justify-self: center;
    }

    .footer-newsletter {
        justify-self: start;
        width: 100%;
    }

    .newsletter-email {
        width: 100%;
    }

    .newsletter-submit {
        align-self: flex-start;
    }

    .footer-address {
        order: 1;
    }

    /* Event quote smaller on mobile */
    .event-quote {
        font-size: 27px;
        margin-left: 0;
        max-width: none;
    }

    /* Shop page mobile */
    .shop-row {
        flex-direction: column;
        gap: 12px;
    }

    .shop-label {
        width: auto;
        text-align: center;
    }

    .shop-grid {
        grid-template-columns: 1fr;
        gap: 40px;
    }

    .shop-card-image {
        width: 260px;
    }
}

/* Checkout Modal */
.checkout-modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: var(--color-white);
    z-index: 2000;
    overflow: hidden;
}

.checkout-modal.is-open {
    display: flex;
}

.checkout-modal-content {
    position: relative;
    background: var(--color-white);
    width: 100%;
    height: 100%;
    overflow-y: auto;
}

.checkout-modal-close {
    position: fixed;
    top: 20px;
    right: 20px;
    width: 40px;
    height: 40px;
    background: var(--color-white);
    border: 1px solid var(--color-gray);
    border-radius: 50%;
    font-size: 24px;
    cursor: pointer;
    z-index: 2001;
    color: var(--color-black);
    display: flex;
    align-items: center;
    justify-content: center;
}

.checkout-modal-close:hover {
    background: var(--color-black);
    color: var(--color-white);
}

/* Thank You Popover */
.thank-you-popover {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 3000;
    align-items: center;
    justify-content: center;
}

.thank-you-popover.is-open {
    display: flex;
}

.thank-you-popover-backdrop {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
}

.thank-you-popover-content {
    position: relative;
    background: var(--color-white);
    padding: 60px 50px;
    text-align: center;
    max-width: 400px;
    width: 90%;
}

.thank-you-lens {
    width: 80px;
    height: auto;
    margin-bottom: 30px;
}

.thank-you-message {
    font-family: "AuthenticSerif", serif;
    font-size: 18px;
    line-height: 1.3;
    margin-bottom: 30px;
}

.thank-you-close {
    font-family: "AuthenticSans", sans-serif;
    font-size: 13px;
    letter-spacing: 0.08em;
    padding: 10px 30px;
    background: #fab53a;
    color: var(--color-black);
    border: none;
    border-radius: 10px;
    cursor: pointer;
}

.thank-you-close:hover {
    opacity: 0.8;
}

#checkout-container {
    min-height: 100vh;
    padding-top: 60px;
}

.buy-btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

/* Cover 3D Flipper */
.cover-flipper {
    position: relative;
    width: 285px;
    margin-bottom: 16px;
}

.cover-flipper-scene {
    width: 285px;
    perspective: 1000px;
    cursor: grab;
}

.cover-flipper-scene:active {
    cursor: grabbing;
}

.cover-flipper-card {
    width: 100%;
    position: relative;
    transform-style: preserve-3d;
    transition: transform 0.6s ease;
}

.cover-flipper-card.is-dragging {
    transition: none;
}

.cover-flipper-card .cover-image {
    display: block;
    width: 100%;
    height: auto;
    margin-bottom: 0;
    user-select: none;
    -webkit-user-drag: none;
}

.cover-flipper-card .cover-front,
.cover-flipper-card .cover-back {
    position: relative;
    backface-visibility: hidden;
}

.cover-flipper-card .cover-back {
    position: absolute;
    top: 0;
    left: 0;
    transform: rotateY(180deg) translateZ(29px);
}

/* Magazine spine/thickness */
.cover-flipper-card::before,
.cover-flipper-card::after {
    content: "";
    position: absolute;
    width: 29px;
    height: 100%;
    top: 0;
}

/* Right edge (page edges) */
.cover-flipper-card::before {
    left: 100%;
    transform-origin: left center;
    transform: rotateY(90deg);
    background:
        linear-gradient(
            var(--pages-overlay, transparent),
            var(--pages-overlay, transparent)
        ),
        url("orbital-studies-issue0-pages.png") center / cover;
    background-size: cover;
}

/* Left edge (spine) */
.cover-flipper-card::after {
    right: 100%;
    transform-origin: right center;
    transform: rotateY(-90deg);
    background:
        linear-gradient(
            var(--spine-overlay, transparent),
            var(--spine-overlay, transparent)
        ),
        url("orbital-studies-issue0-spine.png") center / cover;
    background-size: cover;
}

/* Lighting overlays */
.cover-flipper-card .cover-lighting {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    backface-visibility: hidden;
    transition: background 0.6s ease;
}

.cover-flipper-card.is-dragging .cover-lighting {
    transition: none;
}

.cover-flip-btn {
    position: absolute;
    bottom: 8px;
    right: 8px;
    width: 32px;
    height: 32px;
    background: var(--color-white);
    border: 1px solid var(--color-black);
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 10;
    transition:
        background 0.2s,
        color 0.2s;
}

.cover-flip-btn:hover {
    background: var(--color-black);
    color: var(--color-white);
}

@media (max-width: 700px) {
    .cover-flipper {
        width: 260px;
    }

    .cover-flipper-scene {
        width: 260px;
    }
}
