@import url('https://fonts.googleapis.com/css2?family=Gilda+Display&display=swap');

/* =========================================================================
   QUIET LUXURY - DESIGN SYSTEM (12-Column Focus)
   ========================================================================= */

@font-face {
    font-family: 'GoogleSans';
    src: url('../fonts/GoogleSansFlex-VariableFont_GRAD,ROND,opsz,slnt,wdth,wght.ttf') format('truetype');
    font-weight: 100 900;
    font-style: normal;
    font-display: swap;
}

:root {
    --color-bg: #F5F5F3;
    --color-text: #333333;
    --color-border: #333333;
    --hairline: 0.5px solid rgba(51, 51, 51, 0.4);

    --ease-out-expo: cubic-bezier(0.19, 1, 0.22, 1);
    --speed-fast: 0.4s;
    --speed-slow: 0.8s;

    /* Spacing Tokens */
    --space-xs: 8px;
    --space-sm: 16px;
    --space-md: 24px;
    --space-lg: 32px;
    --space-xl: 48px;
    --space-xxl: 64px;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    scrollbar-width: none;
    -ms-overflow-style: none;
}

html {
    scroll-behavior: smooth;
}

::selection {
    background: var(--color-text);
    color: var(--color-bg);
}

body {
    background-color: var(--color-bg);
    color: var(--color-text);
    font-family: 'GoogleSans', Arial, sans-serif;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    overflow-x: hidden;
}

/* =========================================================================
   TYPOGRAPHY
   ========================================================================= */

a {
    text-decoration: underline;
    text-decoration-thickness: 1px;
    text-underline-offset: 4px;
    text-decoration-color: rgba(51, 51, 51, 0.3);
    color: inherit;
    transition: all var(--speed-fast) var(--ease-out-expo);
}

a:hover,
a:focus-visible {
    text-decoration-color: var(--color-text);
    opacity: 0.8;
}

a:focus-visible {
    outline: 2px solid var(--color-text);
    outline-offset: 4px;
}

h1,
.macro-title {
    font-family: 'Gilda Display', serif;
    font-size: clamp(36px, 6vw, 64px);
    font-weight: 400;
    line-height: 1.1;
    letter-spacing: -0.01em;
    text-transform: none;
}

h2 {
    font-size: clamp(24px, 3.5vw, 36px);
    font-weight: 500;
    line-height: 1.2;
    letter-spacing: -0.01em;
    margin-bottom: 0.5em;
}

h3 {
    font-size: 18px;
    font-weight: 600;
    line-height: 1.3;
    margin-bottom: 0.5em;
}

h4 {
    font-size: 16px;
    font-weight: 500;
    line-height: 1.4;
    margin-bottom: 0.5em;
}

.micro-meta {
    font-size: 11px;
    font-weight: 400;
    opacity: 0.5;
    letter-spacing: 0.06em;
    text-transform: uppercase;
}

p,
.body-text {
    font-size: clamp(15px, 1vw + 12px, 17px);
    line-height: 1.6;
    max-width: 65ch;
    font-weight: 400;
    color: rgba(51, 51, 51, 0.9);
    margin-bottom: 1.5em;
    orphans: 2;
    widows: 2;
    hyphens: auto;
}

p:last-child {
    margin-bottom: 0;
}

p em,
em,
.body-text em {
    font-style: italic;
    font-weight: inherit;
}

p strong,
strong,
b,
.body-text strong {
    font-weight: 600;
}

/* Lists */
ul,
ol {
    margin-bottom: 1.5em;
    padding-left: 1.2em;
    max-width: 65ch;
}

ul {
    list-style-type: none;
}

ul li {
    position: relative;
    font-size: clamp(15px, 1vw + 12px, 17px);
    line-height: 1.6;
    font-weight: 400;
    color: rgba(51, 51, 51, 0.9);
    margin-bottom: 0.6em;
    padding-left: 1em;
}

ul li::before {
    content: "—";
    position: absolute;
    left: -0.2em;
    color: rgba(51, 51, 51, 0.5);
}

ol {
    list-style-type: none;
    counter-reset: custom-counter;
}

ol li {
    position: relative;
    font-size: clamp(15px, 1vw + 12px, 17px);
    line-height: 1.6;
    font-weight: 400;
    color: rgba(51, 51, 51, 0.9);
    margin-bottom: 0.6em;
    padding-left: 1.5em;
    counter-increment: custom-counter;
}

ol li::before {
    content: counter(custom-counter) ".";
    position: absolute;
    left: 0;
    font-family: 'Gilda Display', serif;
    color: rgba(51, 51, 51, 0.5);
    font-size: 14px;
    top: 0.1em;
}

/* Blockquotes */
blockquote {
    margin: 2em 0;
    padding-left: 1.5em;
    border-left: 1px solid rgba(51, 51, 51, 0.2);
    font-family: 'Gilda Display', serif;
    font-size: 20px;
    line-height: 1.4;
    color: var(--color-text);
    max-width: 50ch;
}

blockquote p {
    font-size: inherit;
    line-height: inherit;
    color: inherit;
    max-width: none;
    margin-bottom: 0;
}

/* =========================================================================
   UTILITY CLASSES (Replacing Inline Styles)
   ========================================================================= */

.meta-section {
    padding-top: var(--space-sm);
    border-top: var(--hairline);
}

.meta-row {
    margin-bottom: var(--space-xs);
    opacity: 0.5;
    display: flex;
    gap: var(--space-sm);
}

.meta-value {
    opacity: 0.7;
    margin-top: 4px;
    text-transform: none;
}

.tag-pill {
    display: inline-block;
    margin-right: 5px;
    margin-bottom: 5px;
    padding: 4px 10px;
    border: 1px solid var(--color-border);
    border-radius: 50px;
    text-decoration: none;
    font-size: 11px;
    transition: all var(--speed-fast) ease;
}

.tag-pill:hover {
    background: var(--color-text);
    color: var(--color-bg);
}

.card-link {
    display: block;
    text-decoration: none;
}

.card-title {
    font-size: 20px;
    margin-bottom: var(--space-sm);
    text-transform: none;
}

.section-border-top {
    padding-top: var(--space-xl) !important;
    border-top: var(--hairline);
}

.section-header {
    border-bottom: var(--hairline);
    padding-bottom: var(--space-md);
    margin-bottom: var(--space-lg);
}

.section-intro {
    text-align: center;
    margin-bottom: var(--space-xl);
}

.serif-link {
    font-family: 'Gilda Display', serif;
    font-size: 18px;
    margin-bottom: 5px;
}

.blocks-container>.block {
    margin-bottom: var(--space-lg);
}

/* Horizontal Scroll Layouts */
.horizontal-scroll {
    display: flex;
    gap: var(--space-md);
}

@media (max-width: 768px) {
    .horizontal-scroll {
        overflow-x: auto;
        overflow-y: hidden;
        scroll-snap-type: x mandatory;
        scroll-padding-left: 16px;
        -webkit-overflow-scrolling: touch;
        margin: 0 -16px;
        padding: 0 16px var(--space-md) 16px;
        scrollbar-width: none;
    }

    .horizontal-scroll::-webkit-scrollbar {
        display: none;
    }

    .horizontal-scroll>* {
        scroll-snap-align: start;
        flex-shrink: 0;
    }
}

/* =========================================================================
   UI BUTTONS & COMPONENTS
   ========================================================================= */

.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    cursor: pointer;
    transition: all var(--speed-fast) var(--ease-out-expo);
    text-transform: uppercase;
    font-size: 11px;
    letter-spacing: 0.06em;
    font-weight: 500;
    text-decoration: none;
    border-radius: 50px;
    padding: 12px 24px;
    font-family: inherit;
    border: 1px solid transparent;
    background: transparent;
}

.btn-solid {
    background-color: var(--color-text);
    color: var(--color-bg);
}

.btn-solid:hover,
.btn-solid:focus-visible {
    opacity: 0.8;
}

.btn-outline {
    border-color: var(--color-border);
    color: var(--color-text);
}

.btn-outline:hover {
    background-color: var(--color-text);
    color: var(--color-bg);
    transform: translateY(-2px);
}

.btn-outline-inverted {
    border-color: rgba(255, 255, 255, 0.4);
    color: #fff;
}

.btn-outline-inverted:hover {
    background-color: #fff;
    color: var(--color-text);
}

.btn-circle {
    width: 50px;
    height: 50px;
    border-radius: 50%;
    border: 1px solid var(--color-border);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    text-decoration: none;
    transition: all var(--speed-fast) var(--ease-out-expo);
    padding: 0;
    color: var(--color-text);
}

.btn-circle:hover {
    background-color: var(--color-text);
    color: var(--color-bg);
}

.btn-arrow {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    text-decoration: none;
    text-transform: uppercase;
    font-size: 10px;
    font-weight: 800;
    letter-spacing: 0.06em;
    transition: transform var(--speed-fast) ease;
    color: var(--color-text);
    background: none;
    border: none;
    padding: 0;
    cursor: pointer;
}

.btn-arrow:hover {
    transform: translateX(4px);
}

.btn-arrow svg {
    transition: transform var(--speed-fast) ease;
}

.btn-arrow:hover svg {
    transform: translateX(4px);
}

.gallery-image {
    width: 100%;
    height: auto;
    object-fit: cover;
    filter: contrast(1.05) grayscale(0.05);
}

/* =========================================================================
   SPA TRANSITIONS & LAYOUT
   ========================================================================= */

main {
    opacity: 1;
    transform: translateY(0);
    transition: opacity var(--speed-slow) var(--ease-out-expo),
        transform var(--speed-slow) var(--ease-out-expo);
    padding-top: 0;
}

/* Padding only for content-heavy pages without heroes */
main.article-page,
main.product-page,
main.default-page,
main.search-page {
    padding-top: 56px; /* Offset for fixed nav */
}

main.is-transitioning {
    opacity: 0;
    transform: translateY(-20px);
}

nav {
    position: fixed;
    z-index: 30;
    padding: var(--space-sm) clamp(16px, 4vw, 48px);
    width: 100vw;
    display: flex;
    justify-content: space-between;
    align-items: center;
    top: 0;
    background-color: var(--color-text);
    color: #fff;
    box-shadow: 0 4px 30px rgba(0, 0, 0, 0.1);
}

nav a {
    color: #fff;
    font-size: 13px;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    text-decoration: none;
}

.nav-links {
    display: flex;
    gap: 30px;
}

.burger-btn {
    display: none;
    background: none;
    border: none;
    color: #fff;
    cursor: pointer;
    z-index: 40;
    padding: 5px;
}

.burger-btn svg {
    width: 24px;
    height: 24px;
}

/* Mobile Menu Overlay */
.mobile-menu {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background: var(--color-bg);
    color: var(--color-text);
    z-index: 25;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    gap: var(--space-lg);
    opacity: 0;
    pointer-events: none;
    transition: opacity var(--speed-fast) var(--ease-out-expo);
}

.mobile-menu.is-open {
    opacity: 1;
    pointer-events: auto;
}

.mobile-menu a {
    color: var(--color-text);
    font-size: 24px;
    text-decoration: none;
    font-family: 'Gilda Display', serif;
}

/* =========================================================================
   12-COLUMN GRID SYSTEM
   ========================================================================= */

.grid-12 {
    display: grid;
    grid-template-columns: repeat(12, 1fr);
    column-gap: var(--space-sm);
    row-gap: var(--space-sm);
    padding: 0 clamp(16px, 4vw, 48px);
}

.span-1 {
    grid-column: span 1;
}

.span-2 {
    grid-column: span 2;
}

.span-3 {
    grid-column: span 3;
}

.span-4 {
    grid-column: span 4;
}

.span-5 {
    grid-column: span 5;
}

.span-6 {
    grid-column: span 6;
}

.span-7 {
    grid-column: span 7;
}

.span-8 {
    grid-column: span 8;
}

.span-9 {
    grid-column: span 9;
}

.span-10 {
    grid-column: span 10;
}

.span-11 {
    grid-column: span 11;
}

.span-12 {
    grid-column: span 12;
}

.section-spacing {
    margin-top: var(--space-xl);
    margin-bottom: var(--space-xl);
}

/* =========================================================================
   RESPONSIVE OVERRIDES
   ========================================================================= */

@media (max-width: 1024px) {
    .grid-12 {
        grid-template-columns: repeat(2, 1fr);
    }

    [class*="span-"] {
        grid-column: span 1;
    }

    .span-12 {
        grid-column: span 2;
    }
}

@media (max-width: 768px) {

    /* --- Core spacing --- */
    .grid-12 {
        padding: 0 16px;
        column-gap: 12px;
        row-gap: 12px;
        display: flex;
        flex-direction: column;
    }

    [class*="span-"] {
        width: 100%;
        margin-bottom: 1rem;
    }

    .section-spacing {
        margin-top: 40px;
        margin-bottom: 40px;
    }

    /* --- Typography tightening --- */
    h1,
    .macro-title {
        font-size: clamp(28px, 8vw, 42px);
    }

    h2 {
        font-size: clamp(22px, 5vw, 28px);
    }

    .popular-title {
        font-size: clamp(28px, 8vw, 42px);
    }

    .newsletter-title {
        font-size: clamp(24px, 6vw, 36px);
    }

    .newsletter-text {
        font-size: 16px;
        max-width: 100%;
    }

    p,
    .body-text {
        font-size: 15px;
    }

    /* --- Nav: Burger menu --- */
    nav {
        padding: 12px 16px;
    }

    .logo img {
        height: 20px !important;
    }

    .nav-links {
        display: none;
    }

    .burger-btn {
        display: block;
    }

    /* Ensure the logo is still visible when menu opens due to mix-blend-mode */
    .mobile-menu.is-open~nav {
        mix-blend-mode: normal;
        color: var(--color-text);
    }

    .mobile-menu.is-open~nav a,
    .mobile-menu.is-open~nav button {
        color: var(--color-text);
    }

    .mobile-menu.is-open~nav .logo img {
        filter: none !important;
    }

    /* --- Hero not so tall --- */
    .hero-section {
        height: 70vh;
        margin-bottom: 32px;
    }

    /* --- Article layout: reverse order so content comes first --- */
    .blog-eintrag .grid-12.section-spacing,
    .routine-detail .grid-12.section-spacing {
        display: flex;
        flex-direction: column-reverse;
    }

    /* --- Routine meta box --- */
    .routine-meta-box {
        margin-top: 0 !important;
        border: none !important;
        padding: 0 !important;
        background: transparent !important;
    }

    /* --- Cards in feed --- */
    .feed-item {
        margin-bottom: 32px !important;
    }

    .feed-item .popular-image,
    .home-popular-item .popular-image {
        aspect-ratio: 16/9 !important;
    }

    /* --- Newsletter --- */
    .home-newsletter-section {
        padding-top: 32px;
        border-top: var(--hairline);
    }

    /* --- Pillars --- */
    .home-pillar {
        border-right: none !important;
        border-bottom: var(--hairline);
        padding: 24px 0 !important;
    }

    .home-pillar:last-child {
        border-bottom: none;
    }

    .home-pillar p {
        min-height: auto;
    }

    .home-popular-item {
        border-right: none !important;
        padding: 0 !important;
    }

    .home-newsletter-split {
        padding: 0 !important;
    }
}

/* =========================================================================
   HOMEPAGE SPECIFIC
   ========================================================================= */

/* Hero Section */
.hero-section {
    position: relative;
    width: 100%;
    height: 100vh;
    margin-bottom: var(--space-xl);
    overflow: hidden;
}

.hero-media {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.hero-dev-fallback {
    width: 100%;
    height: 100%;
    background: #eee;
}

.hero-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.3);
    z-index: 1;
}

.hero-text-wrapper {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    text-align: center;
    color: #fff;
    z-index: 2;
    width: 90%;
}

.hero-title {
    margin: 0 auto 10px auto;
    color: #fff;
}

.hero-philosophy {
    color: #fff;
}

/* Pillars Section */
.home-pillars-section {
    margin-bottom: var(--space-xl);
    border-bottom: var(--hairline);
    padding-bottom: var(--space-lg);
}

.home-pillar {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    border-right: var(--hairline);
    padding: 0 20px;
}

.home-pillar:last-child {
    border-right: none;
}

.home-pillar h2 {
    margin-bottom: var(--space-sm);
    line-height: 1;
}

.pillar-divider {
    width: 50px;
    height: 0;
    border-top: var(--hairline);
    margin-bottom: var(--space-sm);
}

.home-pillar p {
    margin-bottom: var(--space-md);
    opacity: 0.7;
    min-height: 60px;
}



/* Popular Section */
.home-popular-section {
    margin-bottom: var(--space-xl);
}

.popular-header {
    text-align: center;
    margin-bottom: var(--space-lg);
}

.popular-title {
    letter-spacing: -0.02em;
}

.home-popular-item {
    padding: 0 var(--space-sm);
}

.home-popular-item:first-child {
    border-right: 1px dashed var(--color-border);
}

.discovery-tags-wrapper {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 10px;
}

@media (max-width: 768px) {
    .discovery-tags-wrapper {
        flex-wrap: nowrap;
        justify-content: flex-start;
    }
}

.popular-link {
    display: block;
    text-decoration: none;
}

.popular-image {
    width: 100%;
    aspect-ratio: 4/3;
    object-fit: cover;
    margin-bottom: var(--space-sm);
    transition: transform var(--speed-slow) var(--ease-out-expo);
}

.popular-link-wrapper {
    overflow: hidden;
    display: block;
    margin-bottom: var(--space-sm);
}

.popular-link:hover .popular-image {
    transform: scale(1.02);
}

.popular-grid-inner {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: var(--space-md);
}

@media (max-width: 768px) {
    .popular-grid-inner {
        display: flex;
        overflow-x: auto;
        overflow-y: hidden;
        scroll-snap-type: x mandatory;
        scroll-padding-left: 16px;
        -webkit-overflow-scrolling: touch;
        gap: var(--space-md);
        margin: 0 -16px;
        padding: 0 16px var(--space-md) 16px;
        scrollbar-width: none;
    }

    .popular-grid-inner::-webkit-scrollbar {
        display: none;
    }

    .popular-card-item {
        scroll-snap-align: start;
        flex-shrink: 0;
        width: 85vw;
    }
}

.popular-item-title {
    margin-bottom: var(--space-xs);
}

.popular-item-meta {
    opacity: 0.5;
}

.popular-empty {
    text-align: center;
    opacity: 0.5;
}





@media print {

    nav,
    footer,
    .home-newsletter-section,
    .hero-section {
        display: none !important;
    }

    body {
        background: #fff;
        color: #000;
    }

    .grid-12 {
        display: block;
    }

    [class*="span-"] {
        width: 100% !important;
    }
}