/* =================================================
   AIVELLE Homepage
   Page-specific styles only

   Shared typography, navigation, footer, newsletter,
   legal modals and core layout are held in global.css.
================================================= */


/* =================================================
   01. Homepage layout utilities
================================================= */

.section-grid-spacing {
    margin-top: clamp(54px, 7vw, 100px);
}

.align-end {
    align-items: end;
}

.section-intro--paper {
    color: var(--paper);
}

.action-spacing-small {
    margin-top: 24px;
}

.action-spacing-medium {
    margin-top: 30px;
}

.action-spacing-large {
    margin-top: 40px;
}

.meta-spacing-top {
    margin-top: 12px;
}

.footer-tagline {
    max-width: 350px;
}

.issue-cover-frame {
    position: relative;
    overflow: hidden;
}

.archive-item-subtitle {
    display: block;
    margin-top: 6px;
    font-size: .72em;
    font-weight: 400;
    letter-spacing: .02em;
    opacity: .58;
}


/* =================================================
   02. Hero containment
================================================= */

.hero {
    position: relative;
    width: 100%;
    max-width: 100%;
}

.hero-media {
    width: 100%;
    height: 100%;
    max-width: 100%;
    overflow: hidden;
}


/* =================================================
   03. Homepage section layering
================================================= */

#editorials,
#style-edit,
#upcoming,
#letters {
    scroll-margin-top: var(--header-height);
}

#discover {
    position: relative;
    z-index: 5;
    background: var(--black);
}


/* =================================================
   04. Coming Soon interactions
================================================= */

.coming-soon-link {
    position: relative;
}

.coming-soon-popup {
    position: absolute;
    top: 50%;
    right: 70px;
    z-index: 20;

    padding: 12px 18px;

    border: 1px solid var(--accent);
    border-radius: 12px;

    color: var(--accent);
    background: #0b0b0b;

    box-shadow: 0 12px 30px rgba(0, 0, 0, .45);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);

    opacity: 0;
    pointer-events: none;
    white-space: nowrap;

    transform: translateY(-50%) translateX(15px);

    transition:
        opacity .45s ease,
        transform .45s ease;
}

.coming-soon-popup.show {
    opacity: 1;
    transform: translateY(-50%) translateX(0);
}

.editorial-coming-soon {
    position: relative;
}

.editorial-coming-soon .coming-soon-centre-layer {
    position: absolute;
    inset: 0;
    z-index: 5;

    display: grid;
    place-items: center;

    pointer-events: none;
}

.editorial-coming-soon .coming-soon-popup {
    position: static;

    width: max-content;
    max-width: calc(100% - 32px);
    margin: 0;

    text-align: center;
    white-space: nowrap;

    transform: none;
}

.editorial-coming-soon .coming-soon-popup.show {
    transform: none;
}

/* =================================================
   Editorial View — textured warm paper
================================================= */

.home-editorial-view {
    position: relative;
    overflow: hidden;

    background: #d8c7ad;
    color: #111111;

    padding:
        clamp(100px, 11vw, 170px)
        var(--page-gutter);
}


/* -------------------------------------------------
   Rough paper texture
-------------------------------------------------- */

.home-editorial-view-texture {
    position: absolute;
    inset: 0;
    z-index: 0;

    pointer-events: none;

    background:
        /* fine dark paper fibres */
        repeating-linear-gradient(
            8deg,
            rgba(83, 67, 47, .045) 0px,
            rgba(83, 67, 47, .045) 1px,
            transparent 1px,
            transparent 5px
        ),

        /* crossing fibres */
        repeating-linear-gradient(
            97deg,
            rgba(255, 255, 255, .09) 0px,
            rgba(255, 255, 255, .09) 1px,
            transparent 1px,
            transparent 7px
        ),

        /* irregular darker grain */
        radial-gradient(
            circle at 14% 18%,
            rgba(88, 68, 44, .11) 0 1px,
            transparent 1.5px
        ),

        radial-gradient(
            circle at 67% 36%,
            rgba(92, 72, 49, .08) 0 1.2px,
            transparent 1.8px
        ),

        radial-gradient(
            circle at 38% 79%,
            rgba(255, 255, 255, .18) 0 1px,
            transparent 1.7px
        ),

        /* broad uneven paper tone */
        radial-gradient(
            ellipse at 20% 25%,
            rgba(255, 250, 239, .30),
            transparent 38%
        ),

        radial-gradient(
            ellipse at 82% 72%,
            rgba(113, 86, 54, .09),
            transparent 42%
        ),

        linear-gradient(
            115deg,
            rgba(255,255,255,.12),
            rgba(117,91,59,.05) 48%,
            rgba(255,255,255,.08)
        );

    background-size:
        auto,
        auto,
        19px 21px,
        27px 31px,
        23px 25px,
        100% 100%,
        100% 100%,
        100% 100%;

    opacity: .88;
}

.home-editorial-view::after {
    content: "";

    position: absolute;
    inset: 0;
    z-index: 0;

    pointer-events: none;

    opacity: .30;

    background-image:
        repeating-radial-gradient(
            ellipse at center,
            rgba(60, 47, 32, .12) 0,
            rgba(60, 47, 32, .12) .5px,
            transparent .8px,
            transparent 3px
        );

    background-size: 11px 9px;
}

.home-editorial-view-shell {
    position: relative;
    z-index: 1;
}


.home-editorial-view-grid {
    width: min(100%, 1500px);
    margin: 0 auto;

    display: grid;
    grid-template-columns:
        minmax(0, 1.04fr)
        minmax(420px, .96fr);

    gap: clamp(60px, 8vw, 130px);

    align-items: start;
}


/* -------------------------------------------------
   Editorial copy
-------------------------------------------------- */

.home-editorial-view-copy {
    padding-top: 6px;
}


.home-editorial-view-kicker {
    margin: 0 0 18px;

    color: var(--accent);

    font-size: 10px;
    line-height: 1.4;

    letter-spacing: .18em;
    text-transform: uppercase;
}


.home-editorial-view-index {
    margin: 0 0 42px;

    color: #827c72;

    font-size: 10px;
    line-height: 1.4;

    letter-spacing: .18em;
    text-transform: uppercase;
}


.home-editorial-view-copy h2 {
    max-width: 780px;
    margin: 0;

    color: #111111;

    font-size: clamp(58px, 6.4vw, 108px);
    font-weight: 400;

    line-height: .88;
    letter-spacing: -.06em;
}


.home-editorial-view-copy h2 span {
    display: block;

    color: #607d91;
}


.home-editorial-view-standfirst {
    max-width: 620px;

    margin: 38px 0 0;

    color: #292724;

    font-size: clamp(20px, 2vw, 30px);
    line-height: 1.38;
}


.home-editorial-view-byline {
    max-width: 620px;

    margin: 24px 0 0;

    color: #756f67;

    font-size: 13px;
    line-height: 1.7;
}


/* -------------------------------------------------
   Editorial link
-------------------------------------------------- */

.home-editorial-view-link {
    display: inline-flex;
    align-items: center;
    gap: 18px;

    margin-top: 38px;

    color: #111111;

    font-size: 10px;
    letter-spacing: .18em;
    text-transform: uppercase;
	padding: 12px 16px;
    background: #000000;
    border: 1px solid var(--accent);
}

.home-editorial-view-link,
.home-editorial-view-link span {
    color: var(--accent);
	font-size: 9px;

    transition:
        transform .35s var(--ease);
}


.home-editorial-view-link:hover span,
.home-editorial-view-link:focus-visible span {
    transform: translateX(6px);
}


/* -------------------------------------------------
   Editorial image
-------------------------------------------------- */

.home-editorial-view-image {
    width: 100%;
    max-width: 600px;

    margin: 0;

    justify-self: end;

    aspect-ratio: 3 / 4;

    overflow: hidden;

    background: #111111;
}


.home-editorial-view-image img {
    display: block;

    width: 100%;
    height: 100%;

    object-fit: cover;
    object-position: center center;
}

/* =================================================
   05. Responsive homepage refinements
================================================= */

@media (min-width: 993px) {

    #discover {
        margin-top: -2px;
        padding-top: calc(var(--section-space) + 2px);
        border-radius: 2px 2px 0 0;
    }

}

@media (max-width: 600px) {

    .hero {
        width: 100%;
        max-width: 100%;
        height: 92svh;
        min-height: 92svh;
        overflow: hidden;
    }

    .hero-media {
        inset: 0;
        width: 100%;
        height: 100%;
        overflow: hidden;
    }

    .hero-media img {
        width: 100%;
        max-width: 100%;
        height: 100%;
        object-fit: cover;
        object-position: center center;
        transform: scale(1.02);
        transform-origin: center center;
    }

    .footer-tagline {
        max-width: 100%;
        margin: 12px auto 0;
    }

    .coming-soon-popup {
        right: 50%;
        transform: translate(50%, -50%) translateY(12px);
    }

    .coming-soon-popup.show {
        transform: translate(50%, -50%) translateY(0);
    }

    .editorial-coming-soon .coming-soon-popup,
    .editorial-coming-soon .coming-soon-popup.show {
        transform: none;
    }

}

/* =================================================
   Editorial View Feature — Mobile
================================================= */

@media (max-width: 600px) {

    .home-editorial-view {
        padding:
            78px
            var(--page-gutter);
    }

    .home-editorial-view-grid {
        grid-template-columns: 1fr;

        gap: 42px;
    }

    .home-editorial-view-copy {
        padding-top: 0;
    }

    .home-editorial-view-kicker {
        margin-bottom: 12px;
    }

    .home-editorial-view-index {
        margin-bottom: 28px;
    }

    .home-editorial-view-copy h2 {
        max-width: 100%;

        font-size: clamp(49px, 14.5vw, 68px);
        line-height: .91;
    }

    .home-editorial-view-standfirst {
        margin-top: 28px;

        font-size: 20px;
    }

    .home-editorial-view-byline {
        margin-top: 20px;
    }

    .home-editorial-view-link {
        margin-top: 30px;
    }

    .home-editorial-view-image {
        width: 98%;
        max-width: none;

        margin: 0 auto;

        justify-self: center;

        aspect-ratio: 3 / 4;
    }

}


/* =================================================
   06. Reduced motion
================================================= */

@media (prefers-reduced-motion: reduce) {

    .coming-soon-popup {
        transition: none;
    }

}


/* =================================================
   AIVELLE Homepage — iPad portrait refinement v2
================================================= */
@media
    (min-width: 601px)
    and (max-width: 1024px)
    and (orientation: portrait) {

    /* -------------------------------------------------
       Opening hero
       Pull the complete text group upward so the CTA/meta
       remain visible before the visitor scrolls.
    -------------------------------------------------- */
    .homepage .hero-content {
        /*
         * Portrait iPads use a much taller canvas than desktop.
         * Because the hero is bottom-aligned, increasing the
         * bottom padding lifts the whole opening text group.
         * This keeps the CTA and Kyoto metadata visible on
         * initial landing without affecting mobile/landscape.
         */
        padding-bottom: clamp(112px, 12vh, 154px);
    }

    .homepage .hero-copy {
        max-width: min(760px, 88vw);
    }

    .homepage .hero h1 {
        font-size: clamp(54px, 7.8vw, 76px);
    }

    /* -------------------------------------------------
       Editor's Note
       On portrait tablets the landscape image becomes a
       full-width editorial plate, with the complete note
       beneath it. This removes the narrow competing columns.
    -------------------------------------------------- */
    .homepage .section .aivelle-grid > .span-7 + .desk-copy {
        grid-column: span 12;
        max-width: 720px;
        padding: 34px 0 0;
    }

    .homepage .section .aivelle-grid > .span-7:has(+ .desk-copy) {
        grid-column: span 12;
        width: min(100%, 820px);
        justify-self: center;
    }

    .homepage .desk-copy .editorial-title {
        max-width: 650px;
    }

    .homepage .desk-copy .body-copy {
        max-width: 680px;
    }

    /* -------------------------------------------------
       The AIVELLE Edit introduction
       Give the explanatory copy a generous two-thirds
       measure rather than a narrow vertical column.
    -------------------------------------------------- */
    #style-edit > .site-shell > .aivelle-grid:first-child > .span-5 {
        grid-column: span 5;
    }

    #style-edit > .site-shell > .aivelle-grid:first-child > .span-4 {
        grid-column: 6 / span 7;
    }

    #style-edit > .site-shell > .aivelle-grid:first-child .section-intro {
        max-width: 650px;
        margin-top: 8px;
    }

    /* -------------------------------------------------
       Feature Editorial
       Keep the feature as an intentional image-overlay:
       copy occupies the left side only, while the image
       remains visible to the right.
    -------------------------------------------------- */
    .journey-section {
        min-height: 88svh;
        align-items: center;
    }

    .journey-section .journey-overlay {
        background:
            linear-gradient(
                90deg,
                rgba(5,5,5,.98) 0%,
                rgba(5,5,5,.94) 35%,
                rgba(5,5,5,.68) 58%,
                rgba(5,5,5,.18) 82%,
                rgba(5,5,5,.08) 100%
            );
    }

    .journey-content .span-6 {
        grid-column: span 7;
    }

    .journey-content .section-heading {
        max-width: 590px;
        font-size: clamp(48px, 7vw, 68px);
    }

    .journey-content .section-intro {
        max-width: 600px;
        font-size: 17px;
        line-height: 1.55;
    }

    .journey-facts {
        max-width: 600px;
        gap: 14px;
    }

    .journey-bg img {
        width: 100%;
        height: 100%;
        object-fit: cover;
        object-position: 62% center;
    }

    /* Do not let the parallax transform create an apparent
       misalignment at tablet portrait widths. */
    .journey-bg.parallax {
        transform: none !important;
    }

}


/* =================================================
   AIVELLE Homepage — shorter iPad portrait hero
   Extra lift for portrait tablet viewports with reduced
   usable height (browser chrome / DevTools simulation).
================================================= */
@media
    (min-width: 601px)
    and (max-width: 1024px)
    and (orientation: portrait)
    and (max-height: 1050px) {

    .homepage .hero-content {
        padding-bottom: clamp(126px, 14vh, 150px);
    }

    .homepage .hero-deck {
        margin-top: 14px;
    }

    .homepage .hero-actions {
        margin-top: 18px;
        gap: 10px 24px;
    }

}


/* =================================================
   AIVELLE Homepage — Issues carousel
================================================= */
.issue-showcase,
.issue-showcase .section,
.issue-showcase-viewport {
    overflow: hidden;
}

.issue-showcase-track {
    display: flex;
    width: 100%;
    transform: translate3d(0,0,0);
    transition: transform 1.25s cubic-bezier(.22,.61,.36,1);
    will-change: transform;
}

.issue-showcase-track.is-resetting {
    transition: none;
}

.issue-showcase-slide {
    flex: 0 0 100%;
    min-width: 100%;
}

.issue-showcase-grid {
    min-height: clamp(430px, 42vw, 650px);
}

.issue-showcase-slide .issue-cover-frame {
    width: 100%;
    aspect-ratio: auto;
    background: transparent;
}

.issue-showcase-slide .issue-cover-frame img {
    display: block;
    width: 100%;
    height: auto;
    object-fit: contain;
}

.issue-showcase-slide .issue-cover-frame::after {
    inset: 0;
}

.issue-coming-soon {
    color: #6d6d68;
    cursor: default;
}

.issue-coming-soon::after {
    display: none;
}

.issue-showcase-pagination {
    display: flex;
    justify-content: center;
    gap: 10px;
    margin-top: clamp(38px, 5vw, 62px);
}

.issue-showcase-pagination button {
    position: relative;
    width: 46px;
    height: 14px;
    padding: 0;
    border: 0;
    background: transparent;
    cursor: pointer;
}

.issue-showcase-pagination button::before {
    content: "";
    position: absolute;
    left: 0;
    right: 0;
    top: 50%;
    height: 2px;
    background: rgba(35,35,35,.24);
    transform: translateY(-50%);
    transition: background-color .45s ease, transform .55s cubic-bezier(.22,.61,.36,1);
}

.issue-showcase-pagination button.is-active::before {
    background: #8d672d;
    transform: translateY(-50%) scaleX(1.28);
}

@media (max-width: 992px) {
    .issue-showcase-grid { min-height: 560px; }
}

@media (max-width: 600px) {
    .issue-showcase-grid { min-height: 0; }
    .issue-showcase-slide .issue-number { margin-bottom: 24px; }
    .issue-showcase-slide .issue-cover-frame { margin-top: 34px; }
    .issue-showcase-pagination { margin-top: 34px; }
    .issue-showcase-pagination button { width: 38px; }
}

@media (prefers-reduced-motion: reduce) {
    .issue-showcase-track { transition: none; }
}


/* =================================================
   AIVELLE Homepage — Issues carousel
   iPad portrait layout refinement only
================================================= */
@media
    (min-width: 601px)
    and (max-width: 1024px)
    and (orientation: portrait) {

    /*
     * Reduce the oversized tablet whitespace created by
     * the site's normal section spacing. This applies only
     * to the white Issues carousel.
     */
    .homepage .issue-showcase .section {
        padding-top: clamp(54px, 6.5vw, 72px);
        padding-bottom: clamp(46px, 5.5vw, 64px);
    }

    /*
     * Rebuild the Issue spread for portrait tablets:
     *
     * left  = number + complete editorial copy
     * right = magazine cover
     *
     * The cover spans both grid rows while the number and
     * copy sit together vertically in the left column.
     */
    .homepage .issue-showcase-grid {
        grid-template-columns:
            repeat(12, minmax(0, 1fr));

        grid-template-rows:
            auto auto;

        column-gap:
            clamp(28px, 4vw, 44px);

        row-gap:
            clamp(12px, 1.8vw, 20px);

        align-content:
            center;

        align-items:
            start;

        min-height:
            0;
    }

    /*
     * Issue number.
     * Keep it first in the reading order and visually tied
     * to the copy beneath it.
     */
    .homepage .issue-showcase-grid > .span-3 {
        grid-column:
            1 / span 6;

        grid-row:
            1;

        align-self:
            end;
    }

    .homepage .issue-showcase-grid > .span-3 .issue-number {
        margin:
            0;

        font-size:
            clamp(88px, 13vw, 118px);

        line-height:
            .78;
    }

    /*
     * Main editorial copy sits directly below the number.
     * It remains left aligned, while the combined left side
     * is vertically balanced against the cover.
     */
    .homepage .issue-showcase-grid > .span-5 {
        grid-column:
            1 / span 6;

        grid-row:
            2;

        align-self:
            start;

        max-width:
            100%;
    }

    .homepage .issue-showcase-grid > .span-5 .eyebrow {
        margin-bottom:
            14px;
    }

    .homepage .issue-showcase-grid > .span-5 .section-heading {
        max-width:
            100%;

        font-size:
            clamp(38px, 5.4vw, 50px);

        line-height:
            .98;
    }

    .homepage .issue-showcase-grid > .span-5 .section-intro {
        max-width:
            100%;

        margin-top:
            18px;

        font-size:
            clamp(15px, 1.85vw, 17px);

        line-height:
            1.5;
    }

    .homepage .issue-showcase-grid > .span-5 .action-spacing-medium {
        margin-top:
            22px;
    }

    /*
     * Magazine cover occupies the complete right column and
     * spans the number and copy rows, keeping the whole spread
     * visually centred.
     */
    .homepage .issue-showcase-grid > .span-4 {
        grid-column:
            7 / span 6;

        grid-row:
            1 / span 2;

        align-self:
            center;

        width:
            100%;

        max-width:
            360px;

        justify-self:
            end;
    }

    .homepage .issue-showcase-slide .issue-cover-frame {
        width:
            100%;

        margin:
            0;
    }

    /*
     * Pull the position strip closer to the spread now that
     * the portrait-tablet composition is more compact.
     */
    .homepage .issue-showcase-pagination {
        margin-top:
            clamp(26px, 3.5vw, 38px);
    }

}

/* =================================================
   Editorial View Feature — iPad portrait
================================================= */

@media
    (min-width: 601px)
    and (max-width: 1024px)
    and (orientation: portrait) {

    .home-editorial-view {
        padding:
            clamp(82px, 9vw, 110px)
            var(--page-gutter);
    }

    .home-editorial-view-grid {
        grid-template-columns:
            minmax(0, 1fr)
            minmax(300px, .82fr);

        gap: clamp(38px, 5vw, 58px);
    }

    .home-editorial-view-copy h2 {
        font-size: clamp(54px, 7.2vw, 72px);
    }

    .home-editorial-view-index {
        margin-bottom: 30px;
    }

    .home-editorial-view-standfirst {
        font-size: clamp(18px, 2.4vw, 23px);
    }

    .home-editorial-view-image {
        width: 100%;
        max-width: 440px;
    }

}
