/* ============================================
   MARY MALLEN WEBSITE - MAIN STYLES
   Vintage Editorial Elegance - 10/10 Quality
   ============================================ */

/* CSS Custom Properties - Enhanced Color Palette */
:root {
    /* Light Mode - Vintage Paper & Sepia */
    --bg-primary: #FAF7F2;
    --bg-secondary: #EDE6DB;
    --bg-tertiary: #E3D5C3;
    --bg-highlight: #F5EEE6;
    --bg-accent: #DCC9B3;
    
    --text-primary: #1A1410;
    --text-secondary: #3D3228;
    --text-tertiary: #6B5D51;
    --text-muted: #8B7D71;
    
    --accent-sepia: #9B7653;
    --accent-rust: #A0522D;
    --accent-ink: #2F4F4F;
    --accent-gold: #C9A961;
    --accent-burgundy: #722F37;
    
    --border-light: #D4C4B0;
    --border-medium: #B5A28F;
    --border-dark: #8B7869;
    --shadow-vintage: rgba(61, 50, 40, 0.15);
    --shadow-deep: rgba(26, 20, 16, 0.25);
    
    /* Interactive States */
    --link-color: #9B7653;
    --link-hover: #7A5E42;
    --button-primary: #A0522D;
    --button-hover: #8B4513;
    
    /* Texture overlays */
    --grain-opacity: 0.035;
    --paper-texture-opacity: 0.02;
}

[data-theme="dark"] {
    /* Dark Mode - Aged Document */
    --bg-primary: #1A1410;
    --bg-secondary: #25201A;
    --bg-tertiary: #2F2820;
    --bg-highlight: #221D17;
    --bg-accent: #3A3028;
    
    --text-primary: #F5EEE6;
    --text-secondary: #E3D5C3;
    --text-tertiary: #C9B9A8;
    --text-muted: #A89888;
    
    --accent-sepia: #C9A961;
    --accent-rust: #CD853F;
    --accent-ink: #7D9D9C;
    --accent-gold: #D4AF6A;
    --accent-burgundy: #A65358;
    
    --border-light: #3A3028;
    --border-medium: #4A3D30;
    --border-dark: #6B5D51;
    --shadow-vintage: rgba(0, 0, 0, 0.4);
    --shadow-deep: rgba(0, 0, 0, 0.6);
    
    --link-color: #C9A961;
    --link-hover: #D4AF6A;
    --button-primary: #A0522D;
    --button-hover: #CD853F;
    
    --grain-opacity: 0.045;
    --paper-texture-opacity: 0.03;
}

@keyframes fadeIn {
    from {
        opacity: 0;
    }
    to {
        opacity: 1;
    }
}

@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(50px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes fadeInScale {
    from {
        opacity: 0;
        transform: translateY(-50%) scale(0.95);
    }
    to {
        opacity: 1;
        transform: translateY(-50%) scale(1);
    }
}

@keyframes slideInTimeline {
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

/* ============================================
   BASE RESET & GRAIN TEXTURE
   ============================================ */

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

html {
    font-size: 16px;
    scroll-behavior: smooth;
    width:100%;
    height:100%;
}

body {
    font-family: 'EB Garamond', 'Libre Baskerville', Georgia, serif;
    font-weight: 400;
    line-height: 1.75;
    color: var(--text-primary);
    background-color: var(--bg-primary);
    transition: background-color 0.5s ease, color 0.5s ease;
    /* Fill iPhone notch areas */
    padding-top: env(safe-area-inset-top);
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    position: relative;
}

/* Authentic grain texture overlay */
body.grain-texture::before {
    content: '';
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 9999;
    opacity: var(--grain-opacity);
    background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 400 400' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='noiseFilter'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='2.5' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23noiseFilter)'/%3E%3C/svg%3E");
    mix-blend-mode: overlay;
}

/* Only animate grain on desktop for performance */
@media (min-width: 1024px) {
    body.grain-texture::before {
        animation: grain 8s steps(10) infinite;
    }
}

[data-theme="dark"] body.grain-texture::before {
    mix-blend-mode: soft-light;
}

@keyframes grain {
    0%, 100% { transform: translate(0, 0); }
    10% { transform: translate(-5%, -10%); }
    20% { transform: translate(-15%, 5%); }
    30% { transform: translate(7%, -25%); }
    40% { transform: translate(-5%, 25%); }
    50% { transform: translate(-15%, 10%); }
    60% { transform: translate(15%, 0%); }
    70% { transform: translate(0%, 15%); }
    80% { transform: translate(3%, 35%); }
    90% { transform: translate(-10%, 10%); }
}

/* ============================================
   SITE NAVIGATION - PERFECT MOBILE & iPAD
   ============================================ */

.site-header {
    position: sticky;
    top: 0;
    z-index: 1000;
    border-bottom: 2px solid var(--border-medium);
    box-shadow: 0 4px 20px var(--shadow-vintage);
    transition: all 0.4s ease;
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    background-color: var(--bg-primary);
    /* Extend header into iPhone notch area */
    padding-top: env(safe-area-inset-top);
    margin-top: calc(-1 * env(safe-area-inset-top));
}

.site-header::before {
    content: '';
    position: absolute;
    inset: 0;
    background-color: var(--bg-primary);
    opacity: 0.95;
    z-index: -1;
    /* Extend background into notch */
    top: calc(-1 * env(safe-area-inset-top));
    padding-top: env(safe-area-inset-top);
}

[data-theme="dark"] .site-header {
    background-color: var(--bg-primary);
}

.header-content {
    max-width: 1600px;
    margin: 0 auto;
    padding: 1.25rem 2.5rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 2rem;
}

/* Logo - Distinctive Typography */
.logo a {
    font-family: 'Cormorant Garamond', Georgia, serif;
    font-size: 1.75rem;
    font-weight: 700;
    color: var(--text-primary);
    text-decoration: none;
    letter-spacing: 0.05em;
    transition: all 0.3s ease;
    position: relative;
}

.logo a::after {
    content: '';
    position: absolute;
    bottom: -4px;
    left: 0;
    width: 0;
    height: 2px;
    background: var(--accent-gold);
    transition: width 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

.logo a:hover::after,
.logo a:focus::after {
    width: 100%;
}

/* Main Navigation - Desktop */
.main-nav {
    flex-grow: 1;
    display: none;
}


.nav-list {
    display: flex;
    list-style: none;
    gap: 2.5rem;
    justify-content: center;
}

.nav-list a {
    font-family: 'Libre Baskerville', Georgia, serif;
    font-weight: 400;
    font-size: 0.9rem;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: var(--text-secondary);
    text-decoration: none;
    padding: 0.5rem 0;
    position: relative;
    transition: color 0.3s ease;
    display: inline-block;
}

.nav-list a::before {
    content: '';
    position: absolute;
    bottom: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 0;
    height: 1px;
    background: var(--accent-sepia);
    transition: width 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

.nav-list a:hover::before,
.nav-list a:focus::before {
    width: 100%;
}

.nav-list a:hover,
.nav-list a:focus {
    color: var(--accent-sepia);
}

.nav-list a[aria-current="page"] {
    color: var(--accent-sepia);
}

.nav-list a[aria-current="page"]::before {
    width: 100%;
}

/* Mobile Menu Toggle */
.menu-toggle {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 48px;
    height: 48px;
    background: none;
    border: 1px solid var(--border-medium);
    cursor: pointer;
    padding: 0;
    transition: all 0.3s ease;
}


.menu-toggle:hover {
    border-color: var(--accent-sepia);
    background-color: var(--bg-highlight);
}

.hamburger {
    width: 22px;
    height: 2px;
    background-color: var(--text-primary);
    position: relative;
    transition: all 0.3s ease;
}

.hamburger::before,
.hamburger::after {
    content: '';
    position: absolute;
    left: 0;
    width: 22px;
    height: 2px;
    background-color: var(--text-primary);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.hamburger::before {
    top: -7px;
}

.hamburger::after {
    bottom: -7px;
}

.menu-toggle[aria-expanded="true"] .hamburger {
    background-color: transparent;
}

.menu-toggle[aria-expanded="true"] .hamburger::before {
    top: 0;
    transform: rotate(45deg);
}

.menu-toggle[aria-expanded="true"] .hamburger::after {
    bottom: 0;
    transform: rotate(-45deg);
}

/* Mobile & Tablet Menu - PERFECT FOR ALL DEVICES */
@media (max-width: 1024px) {
    .main-nav {
        position: absolute;
        top: 100%;
        left: 0;
        right: 0;
        background-color: var(--bg-primary);
        border-bottom: 2px solid var(--border-medium);
        box-shadow: 0 8px 30px var(--shadow-deep);
        max-height: 0;
        overflow: hidden;
        transition: max-height 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    }
    
    .main-nav.active {
        display: block;
        max-height: 500px;
    }
    
    .nav-list {
        flex-direction: column;
        gap: 0;
        padding: 1rem 0;
    }
    
    .nav-list a {
        display: block;
        padding: 1.25rem 2.5rem;
        font-size: 1rem;
        border-left: 3px solid transparent;
        transition: all 0.3s ease;
        min-height: 48px;
        display: flex;
        align-items: center;
    }
    
    .nav-list a:hover,
    .nav-list a:focus {
        background-color: var(--bg-highlight);
        border-left-color: var(--accent-sepia);
    }
    
    .nav-list a[aria-current="page"] {
        background-color: var(--bg-highlight);
        border-left-color: var(--accent-sepia);
    }
    
    .nav-list a::before {
        display: none;
    }
}

/* Theme Toggle - Refined Icon */
.theme-toggle {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 48px;
    height: 48px;
    background: none;
    border: 1px solid var(--border-medium);
    cursor: pointer;
    transition: all 0.3s ease;
    flex-shrink: 0;
}

.theme-toggle:hover,
.theme-toggle:focus {
    background-color: var(--bg-highlight);
    border-color: var(--accent-gold);
}

.theme-toggle svg {
    color: var(--text-primary);
    transition: transform 0.5s cubic-bezier(0.4, 0, 0.2, 1);
}

.theme-toggle:hover svg {
    transform: rotate(20deg);
}

.sun-icon {
    display: none;
}

[data-theme="light"] .sun-icon {
    display: block;
}

[data-theme="light"] .moon-icon {
    display: none;
}

[data-theme="dark"] .sun-icon {
    display: none;
}

[data-theme="dark"] .moon-icon {
    display: block;
}

/* ============================================
   RESPONSIVE NAVIGATION - DEVICE SPECIFIC
   ============================================ */

/* iPad Mini (744px - 834px) Portrait */
@media (min-width: 744px) and (max-width: 834px) and (orientation: portrait) {
    .header-content {
        padding: 1.125rem 2rem;
    }
    
    .logo a {
        font-size: 1.625rem;
    }
}

/* iPad Air & Pro (835px - 1024px) Portrait & Landscape */
@media (min-width: 835px) and (max-width: 1024px) {
    .header-content {
        padding: 1.25rem 2.5rem;
    }
    
    .logo a {
        font-size: 1.75rem;
    }
}

/* Mobile Phones (below 744px) */
@media (max-width: 743px) {
    .header-content {
        padding: 1rem 1.5rem;
    }
    
    .logo a {
        font-size: 1.5rem;
    }
    
    .nav-list a {
        padding: 1.125rem 1.5rem;
        font-size: 0.95rem;
    }
}

/* Small Mobile (below 400px) */
@media (max-width: 399px) {
    .header-content {
        padding: 0.875rem 1rem;
        gap: 1rem;
    }
    
    .logo a {
        font-size: 1.25rem;
    }
    
    .menu-toggle,
    .theme-toggle {
        width: 44px;
        height: 44px;
    }
}

/* ============================================
   TYPOGRAPHY - DISTINCTIVE & REFINED
   ============================================ */

h1, h2, h3, h4, h5, h6 {
    font-family: 'Cormorant Garamond', Georgia, serif;
    font-weight: 600;
    line-height: 1.2;
    color: var(--text-primary);
    margin-bottom: 1.25rem;
    letter-spacing: -0.02em;
}

h1 {
    font-size: clamp(2.75rem, 7vw, 5rem);
    font-weight: 700;
    letter-spacing: -0.04em;
}

h2 {
    font-size: clamp(1.75rem, 5vw, 3rem);
    font-weight: 600;
}

h3 {
    font-size: clamp(1.375rem, 3.5vw, 2rem);
    font-weight: 600;
}

/* Body text - refined serif */
p {
    font-size: 1.125rem;
    line-height: 1.85;
    margin-bottom: 1.5rem;
    color: var(--text-primary);
    font-family: 'EB Garamond', Georgia, serif;
}

/* Drop cap for special paragraphs */
.drop-cap-first::first-letter {
    float: left;
    font-family: 'Cormorant Garamond', Georgia, serif;
    font-size: 4.5rem;
    line-height: 0.85;
    font-weight: 700;
    margin-right: 0.15em;
    margin-top: 0.1em;
    color: var(--accent-sepia);
}

/* Links with underline animation */
a {
    color: var(--link-color);
    text-decoration: none;
    position: relative;
    transition: color 0.3s ease;
}

a:hover,
a:focus {
    color: var(--link-hover);
}

/* Handwritten text style */
.handwritten {
    font-family: 'Mrs Saint Delafield', cursive;
    font-size: 1.5rem;
    color: var(--accent-sepia);
    opacity: 0.7;
}

/* Column text for newspaper feel */
.column-text {
    column-count: 1;
}

@media (min-width: 768px) {
    .column-text {
        column-count: 2;
        column-gap: 3rem;
        column-rule: 1px solid var(--border-light);
    }
}

/* Prose columns for isolation section */
.prose-columns {
    max-width: 900px;
    margin: 0 auto 2rem;
}

/* ============================================
   DECORATIVE ELEMENTS & ORNAMENTS
   ============================================ */

.title-ornament {
    display: inline-block;
    font-size: 0.6em;
    color: var(--accent-gold);
    margin: 0 0.5rem;
    opacity: 0.7;
}

.title-flourish-top,
.title-flourish-bottom {
    display: block;
    text-align: center;
    font-size: 1.5rem;
    color: var(--accent-gold);
    opacity: 0.5;
    margin: 0.5rem 0;
}

.decorative-rule {
    width: 120px;
    height: 2px;
    background: linear-gradient(90deg, 
        transparent 0%, 
        var(--accent-gold) 20%, 
        var(--accent-gold) 80%, 
        transparent 100%);
    margin: 1.5rem 0;
}

/* Section ornaments */
.section-ornament-top,
.section-ornament-bottom {
    height: 40px;
    width: 100%;
    background-image: 
        repeating-linear-gradient(
            90deg,
            var(--border-medium),
            var(--border-medium) 2px,
            transparent 2px,
            transparent 12px
        );
    opacity: 0.3;
}

/* ============================================
   LAYOUT CONTAINERS
   ============================================ */

.section-container {
    max-width: 1400px;
    margin: 0 auto;
    padding: 5rem 2rem;
    position: relative;
}

/* ============================================
   PULL QUOTES - DRAMATIC & DISTINCTIVE
   ============================================ */

.pull-quote-large {
    position: relative;
    max-width: 800px;
    margin: 4rem auto;
    padding: 3rem 2rem;
    text-align: center;
    background: linear-gradient(135deg, 
        var(--bg-highlight) 0%, 
        var(--bg-accent) 100%);
    border-top: 3px solid var(--accent-gold);
    border-bottom: 3px solid var(--accent-gold);
    box-shadow: 0 8px 30px var(--shadow-vintage);
}

.quote-mark-open,
.quote-mark-close {
    position: absolute;
    font-family: 'Cormorant Garamond', Georgia, serif;
    font-size: 8rem;
    font-weight: 700;
    color: var(--accent-gold);
    opacity: 0.2;
    line-height: 1;
}

.quote-mark-open {
    top: -1rem;
    left: 1rem;
}

.quote-mark-close {
    bottom: -3rem;
    right: 1rem;
}

.quote-text {
    font-family: 'Cormorant Garamond', Georgia, serif;
    font-size: clamp(1.5rem, 3vw, 2rem);
    font-style: italic;
    font-weight: 400;
    line-height: 1.6;
    color: var(--text-secondary);
    margin: 0;
}

/* Side pull quote */
.pull-quote-side {
    float: right;
    width: 300px;
    margin: 1rem 0 2rem 2rem;
    padding: 1.5rem;
    background-color: var(--bg-highlight);
    border-left: 4px solid var(--accent-sepia);
    position: relative;
}

.pull-quote-side p {
    font-family: 'Cormorant Garamond', Georgia, serif;
    font-size: 1.25rem;
    font-style: italic;
    line-height: 1.5;
    margin: 0;
    color: var(--text-secondary);
}

.side-quote-ornament {
    position: absolute;
    top: -10px;
    right: 10px;
    font-size: 1.5rem;
    color: var(--accent-gold);
}

/* ============================================
   MARGIN NOTES - HANDWRITTEN EFFECT
   ============================================ */

.margin-note {
    position: absolute;
    top: 20%;
    transform: rotate(-3deg);
    z-index: 10;
}

.margin-note.left {
    left: -150px;
}

.margin-note.right {
    right: -150px;
    transform: rotate(3deg);
}

@media (max-width: 1200px) {
    .margin-note {
        display: none;
    }
}

/* ============================================
   BUTTONS & CTAs - REFINED INTERACTIONS
   ============================================ */

.cta-button {
    display: inline-flex;
    align-items: center;
    gap: 1rem;
    padding: 1.25rem 2.5rem;
    font-family: 'Libre Baskerville', Georgia, serif;
    font-weight: 700;
    font-size: 0.95rem;
    letter-spacing: 0.05em;
    text-transform: uppercase;
    color: #fff;
    background-color: var(--button-primary);
    border: 2px solid var(--button-primary);
    cursor: pointer;
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    text-decoration: none;
    box-shadow: 
        0 4px 12px var(--shadow-vintage),
        inset 0 -2px 0 rgba(0,0,0,0.2);
    position: relative;
    overflow: hidden;
}

.cta-button::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, 
        transparent, 
        rgba(255,255,255,0.2), 
        transparent);
    transition: left 0.5s ease;
}

.cta-button:hover::before {
    left: 100%;
}

.cta-button:hover,
.cta-button:focus {
    background-color: var(--button-hover);
    border-color: var(--button-hover);
    transform: translateY(-2px);
    box-shadow: 
        0 8px 24px var(--shadow-deep),
        inset 0 -2px 0 rgba(0,0,0,0.3);
}

.button-ornament {
    font-size: 1.25rem;
    transition: transform 0.3s ease;
}

.cta-button:hover .button-ornament {
    transform: translateX(4px);
}

/* Text link with underline effect */
.cta-link {
    display: inline-flex;
    align-items: center;
    gap: 0.75rem;
    font-family: 'Libre Baskerville', Georgia, serif;
    font-size: 1rem;
    font-weight: 700;
    color: var(--link-color);
    text-decoration: none;
    position: relative;
    padding-bottom: 4px;
    transition: color 0.3s ease;
}

.cta-link::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    width: 0%;
    height: 2px;
    background: var(--accent-gold);
    transition: width 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

.cta-link:hover::after,
.cta-link:focus::after {
    width: 100%;
}

.cta-link:hover,
.cta-link:focus {
    color: var(--link-hover);
}

/* ============================================
   SECTION TITLES - EDITORIAL STYLE
   ============================================ */

.section-title {
    font-family: 'Cormorant Garamond', Georgia, serif;
    font-size: clamp(2rem, 5vw, 3.5rem);
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 2.5rem;
    position: relative;
    text-align: left;
}

.section-title.editorial {
    text-align: center;
    letter-spacing: 0.02em;
}

.section-title.centered {
    text-align: center;
}

/* ============================================
   ACCESSIBILITY
   ============================================ */

/* Screen reader only class */
.sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border-width: 0;
}

.skip-link {
    position: absolute;
    top: -100px;
    left: 0;
    background: var(--button-primary);
    color: #fff;
    padding: 1rem 1.5rem;
    text-decoration: none;
    font-weight: 700;
    z-index: 10000;
    border-radius: 0 0 4px 0;
    transition: top 0.2s ease;
}

.skip-link:focus {
    top: 0;
    outline: 3px solid var(--accent-gold);
    outline-offset: 2px;
}

*:focus-visible {
    outline: 3px solid var(--accent-gold);
    outline-offset: 3px;
}

/* Remove focus outline for mouse users */
*:focus:not(:focus-visible) {
    outline: none;
}

/* High contrast mode support */


@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
        scroll-behavior: auto !important;
    }
    
    body.grain-texture::before {
        animation: none;
    }
}

/* ============================================
   RESPONSIVE ADJUSTMENTS
   ============================================ */

@media (max-width: 768px) {
    .cta-button {
        padding: 1rem 1.75rem;
        font-size: 0.875rem;
    }


    html {
        font-size: 15px;
    }
    
    p {
        font-size: 1.0625rem;
    }
    
    .section-container {
        padding: 3rem 1.5rem;
    }
    
    .pull-quote-side {
        float: none;
        width: 100%;
        margin: 2rem 0;
    }
    
    .drop-cap-first::first-letter {
        font-size: 3.5rem;
    }
}

@media (max-width: 480px) {
    .cta-button {
        padding: 0.875rem 1.5rem;
        font-size: 0.8125rem;
        width: 100%;
        justify-content: center;
    }

    .section-container {
        padding: 2.5rem 1rem;
    }
}


/* ============================================
   NEWSPAPER EDGE DECORATION - SHARED
   ============================================ */

.newspaper-edge-top,
.newspaper-edge-bottom {
    height: 12px;
    width: 100%;
    background-image: 
        repeating-linear-gradient(
            90deg,
            var(--bg-primary) 0px,
            var(--bg-primary) 4px,
            transparent 4px,
            transparent 8px
        );
    opacity: 0.4;
}

.newspaper-edge-top {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
}

.newspaper-edge-bottom {
    position: absolute;
    bottom: -12px;
    left: 0;
    right: 0;
}

img {
    max-width: 100%;
    height: auto;
    display: block;
}


/* ============================================
   PORTRAIT FRAME - SHARED
   ============================================ */

.portrait-vintage-frame {
    position: relative;
    width: 100%;
    max-width: 480px;
    aspect-ratio: 3/4;
    margin: 0 auto;
    background: linear-gradient(135deg, 
        var(--bg-tertiary) 0%, 
        var(--bg-accent) 100%);
    padding: 20px;
    box-shadow: 
        0 20px 60px var(--shadow-deep),
        inset 0 0 0 1px var(--border-dark);
    /* Critical iOS Safari fix: prevent image from escaping frame boundaries */
    overflow: hidden;
}

/* Vintage corner ornaments */
.frame-corner {
    position: absolute;
    width: 30px;
    height: 30px;
    border-color: var(--accent-gold);
    border-style: solid;
    opacity: 0.6;
}

.frame-corner.tl {
    top: 8px;
    left: 8px;
    border-width: 2px 0 0 2px;
}

.frame-corner.tr {
    top: 8px;
    right: 8px;
    border-width: 2px 2px 0 0;
}

.frame-corner.bl {
    bottom: 8px;
    left: 8px;
    border-width: 0 0 2px 2px;
}

.frame-corner.br {
    bottom: 8px;
    right: 8px;
    border-width: 0 2px 2px 0;
}

.portrait-image {
    /* Use absolute inset so iOS Safari correctly fills aspect-ratio parent */
    position: absolute;
    inset: 20px; /* matches frame padding */
    background: linear-gradient(135deg,
        #8B7869 0%,
        #A89888 50%,
        #8B7869 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
}

/* Style for actual img tags inside portrait */
.portrait-image img {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: center;
    display: block;
}

.portrait-image::after {
    content: 'Authentic portrait\Aof Mary Mallen';
    white-space: pre;
    text-align: center;
    font-family: 'Libre Baskerville', Georgia, serif;
    font-size: 0.875rem;
    font-style: italic;
    color: var(--bg-primary);
    opacity: 0.4;
}

/* Hide the after pseudo-element if there's an actual image */
.portrait-image:has(img)::after {
    display: none;
}

.portrait-sepia-overlay {
    position: absolute;
    inset: 0;
    background: radial-gradient(
        circle at center,
        transparent 0%,
        rgba(0,0,0,0.2) 100%
    );
}

/* ============================================
   SITE FOOTER - UNIFIED ACROSS ALL PAGES
   ============================================ */

.site-footer {
    background-color: var(--bg-secondary);
    border-top: 3px double var(--border-dark);
    padding: 3rem 2rem;
    text-align: center;
}

.footer-content {
    max-width: 1400px;
    margin: 0 auto;
}

.footer-content nav {
    margin-bottom: 1.5rem;
    /* Wrap links on small screens */
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    align-items: center;
    gap: 0;
}

.footer-content nav a {
    font-family: 'Libre Baskerville', Georgia, serif;
    font-size: 0.875rem;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: var(--text-tertiary);
    text-decoration: none;
    transition: color 0.3s ease;
}

.footer-content nav a:hover,
.footer-content nav a:focus {
    color: var(--accent-sepia);
}

/* separator spans */
.footer-content .separator,
.separator {
    margin: 0 0.75rem;
    color: var(--border-medium);
    font-family: 'EB Garamond', Georgia, serif;
}

.copyright {
    font-family: 'EB Garamond', Georgia, serif;
    font-size: 0.875rem;
    font-style: italic;
    color: var(--text-muted);
    margin: 0;
}

/* iPad footer — stack links vertically, hide separators (601px–1024px) */
@media (min-width: 601px) and (max-width: 1024px) {
    .site-footer {
        padding: 3rem 2rem;
    }

    .footer-content nav {
        display: flex;
        flex-direction: column;
        align-items: center;
        gap: 0.85rem;
        margin-bottom: 1.5rem;
    }

    .footer-content .separator,
    .separator {
        display: none;
    }

    .footer-content nav a {
        font-size: 0.875rem;
        letter-spacing: 0.08em;
        padding: 0.3rem 0;
    }

    .copyright {
        font-size: 0.875rem;
    }
}

/* Mobile footer — hide separators & stack links (max 600px) */
@media (max-width: 600px) {
    .footer-content nav {
        display: flex;
        flex-direction: column;
        align-items: center;
        gap: 0.6rem;
        margin-bottom: 1.25rem;
    }

    .footer-content .separator,
    .separator {
        display: none;
    }

    .footer-content nav a {
        font-size: 0.8125rem;
        padding: 0.25rem 0;
    }

    .site-footer {
        padding: 2.5rem 1.25rem;
    }
}

@media (min-width: 1025px) {
.main-nav {
        display: block;
    }

.menu-toggle {
        display: none;
    }
}

@media (hover: none) and (pointer: coarse) {
    .cta-button { min-height: 48px; }
}
