/* 
    Estanislao Santos - Premium Editorial Theme
    Deep Dark, immersive, cinematic aesthetic
*/

@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600&family=Playfair+Display:ital,wght@0,400;0,600;0,700;1,400&display=swap');

:root {
    --bg-base: #0a0a0c;
    --bg-offset: #141417;
    --bg-glass: rgba(10, 10, 12, 0.7);
    --text-main: #f5f5f7;
    --text-muted: #a1a1a6;
    --accent: #d4af37; /* Subtle elegant gold/warm tone for photography highlights */
    --accent-hover: #f1c40f;
    --border: rgba(255, 255, 255, 0.08);

    --font-heading: 'Playfair Display', serif;
    --font-body: 'Inter', sans-serif;

    --space-xs: 0.5rem;
    --space-sm: 1rem;
    --space-md: 2.5rem;
    --space-lg: 5rem;
    --space-xl: 8rem;

    --transition-smooth: all 0.6s cubic-bezier(0.16, 1, 0.3, 1);
    --transition-fast: all 0.3s ease;
}

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

body {
    font-family: var(--font-body);
    color: var(--text-main);
    background-color: var(--bg-base);
    line-height: 1.6;
    font-size: 1rem;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    overflow-x: hidden;
}

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

/* Typography */
h1, h2, h3, .brand {
    font-family: var(--font-heading);
    font-weight: 600;
    line-height: 1.1;
    letter-spacing: -0.01em;
}

h1 {
    font-size: clamp(3rem, 6vw, 5.5rem);
    margin-bottom: var(--space-sm);
    color: var(--text-main);
}

h2 {
    font-size: 1.8rem;
    margin-bottom: var(--space-xs);
    font-weight: 500;
}

p {
    margin-bottom: var(--space-md);
    font-weight: 300;
}

a {
    color: var(--text-main);
    text-decoration: none;
    transition: var(--transition-fast);
}

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

/* Layout */
.container {
    max-width: 1600px;
    margin: 0 auto;
    padding: 0 var(--space-md);
}

/* Header */
.site-header {
    padding: 1.5rem 0;
    position: sticky;
    top: 0;
    background: var(--bg-glass);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    z-index: 100;
    border-bottom: 1px solid var(--border);
    transition: var(--transition-smooth);
}

.site-header nav {
    max-width: 1600px;
    margin: 0 auto;
    padding: 0 var(--space-md);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.brand {
    font-size: 1.5rem;
    font-weight: 700;
    letter-spacing: 0.02em;
    color: var(--text-main);
}

.brand span {
    font-family: var(--font-body);
    font-weight: 300;
    font-size: 0.9rem;
    text-transform: uppercase;
    letter-spacing: 0.2em;
    color: var(--text-muted);
    display: block;
    margin-top: -5px;
}

.nav-links a {
    margin-left: 2.5rem;
    font-family: var(--font-body);
    font-size: 0.85rem;
    text-transform: uppercase;
    letter-spacing: 0.15em;
    font-weight: 500;
    color: var(--text-muted);
    position: relative;
}

.nav-links a::after {
    content: '';
    position: absolute;
    width: 0;
    height: 1px;
    bottom: -4px;
    left: 0;
    background-color: var(--accent);
    transition: width 0.3s ease;
}

.nav-links a:hover::after,
.nav-links a.active::after {
    width: 100%;
}

.nav-links a:hover,
.nav-links a.active {
    color: var(--text-main);
}

/* Hero Section */
.hero {
    max-width: 1000px;
    margin: var(--space-xl) auto;
    text-align: center;
    position: relative;
}

.hero p {
    font-size: clamp(1.1rem, 1.5vw, 1.3rem);
    color: var(--text-muted);
    max-width: 700px;
    margin: 0 auto;
    line-height: 1.8;
}

/* Gallery Header / Filters */
.gallery-header {
    text-align: center;
    margin-bottom: var(--space-lg);
    padding-top: var(--space-md);
}

.gallery-header p {
    color: var(--text-muted);
    max-width: 600px;
    margin: 0 auto;
}

.filters {
    margin-top: var(--space-md);
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 1rem;
}

.filter-btn {
    background: transparent;
    border: 1px solid var(--border);
    padding: 0.6rem 2rem;
    font-family: var(--font-body);
    font-size: 0.8rem;
    text-transform: uppercase;
    letter-spacing: 0.15em;
    font-weight: 500;
    color: var(--text-muted);
    cursor: pointer;
    transition: var(--transition-fast);
    border-radius: 4px;
}

.filter-btn:hover,
.filter-btn:focus,
.filter-btn.active {
    background: var(--text-main);
    color: var(--bg-base);
    border-color: var(--text-main);
}

/* Grid */
.gallery-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: var(--space-lg) var(--space-md);
    margin-bottom: var(--space-xl);
}

@media (min-width: 768px) {
    .gallery-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (min-width: 1200px) {
    .gallery-grid {
        grid-template-columns: repeat(3, 1fr);
        gap: var(--space-lg) 3rem;
    }
}

/* Cards */
.card {
    display: block;
    position: relative;
    group: card-hover;
}

.card figure {
    width: 100%;
    aspect-ratio: 4/3;
    overflow: hidden;
    background: var(--bg-offset);
    position: relative;
    border-radius: 2px;
}

.card img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
    transition: transform 1.2s cubic-bezier(0.16, 1, 0.3, 1), filter 0.8s ease;
    filter: brightness(0.8) contrast(1.1);
}

.card:hover img {
    transform: scale(1.04);
    filter: brightness(1) contrast(1.05);
}

/* Photo Description Wrapper in Grid */
.card-content {
    padding: var(--space-sm) 0 0 0;
    position: relative;
}

.card-category {
    font-family: var(--font-body);
    font-size: 0.7rem;
    text-transform: uppercase;
    letter-spacing: 0.15em;
    color: var(--accent);
    margin-bottom: 0.5rem;
    display: block;
    font-weight: 600;
}

.card-content h2 {
    font-size: 1.4rem;
    margin-bottom: 0.5rem;
    color: var(--text-main);
    transition: color 0.3s ease;
}

.card:hover .card-content h2 {
    color: var(--accent);
}

.card-content p {
    font-size: 0.9rem;
    color: var(--text-muted);
    margin-bottom: 0;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    line-height: 1.5;
}

/* Single Photo Page */
.single-photo {
    max-width: 1400px;
    margin-bottom: var(--space-xl);
    padding-top: var(--space-md);
}

.main-figure {
    margin-bottom: var(--space-lg);
    background: transparent;
    padding: 0;
    border-radius: 0;
    position: relative;
}

.main-figure img {
    width: 100%;
    height: auto;
    display: block;
    object-fit: contain;
    max-height: 85vh;
    box-shadow: 0 20px 50px rgba(0,0,0,0.5);
    transition: transform 0.5s ease;
}

.main-figure figcaption {
    margin-top: var(--space-sm);
    font-family: var(--font-body);
    font-size: 0.8rem;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    color: var(--text-muted);
    text-align: right;
    border-bottom: 1px solid var(--border);
    padding-bottom: 1rem;
    display: inline-block;
    float: right;
}

.photo-details {
    max-width: 800px;
    margin: var(--space-lg) auto;
    clear: both;
}

.photo-details h1 {
    font-size: clamp(2.5rem, 4vw, 3.5rem);
    margin-bottom: var(--space-md);
    text-align: left;
}

.story p {
    font-size: 1.15rem;
    color: var(--text-muted);
    line-height: 1.8;
}

.story p::first-letter {
    font-size: 4.5rem;
    line-height: 0.8;
    float: left;
    margin-right: 0.8rem;
    margin-top: 0.2rem;
    color: var(--text-main);
    font-family: var(--font-heading);
    font-style: italic;
}

/* Navigation Buttons */
.photo-nav {
    display: grid;
    grid-template-columns: 1fr auto 1fr;
    gap: var(--space-sm);
    align-items: center;
    border-top: 1px solid var(--border);
    padding-top: var(--space-lg);
    margin-top: var(--space-lg);
}

.nav-prev {
    text-align: left;
}

.nav-next {
    text-align: right;
}

.btn,
.btn-outline {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 1rem 2.5rem;
    font-family: var(--font-body);
    font-size: 0.8rem;
    text-transform: uppercase;
    letter-spacing: 0.15em;
    font-weight: 500;
    transition: var(--transition-fast);
    border-radius: 2px;
}

.btn {
    background: var(--text-main);
    color: var(--bg-base);
    border: 1px solid var(--text-main);
}

.btn:hover,
.btn:focus {
    background: transparent;
    color: var(--text-main);
}

.btn-outline {
    background: transparent;
    color: var(--text-muted);
    border: 1px solid var(--border);
}

.btn-outline:hover,
.btn-outline:focus {
    border-color: var(--text-main);
    color: var(--text-main);
}

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

/* Footer */
.site-footer {
    background: var(--bg-offset);
    border-top: 1px solid var(--border);
    color: var(--text-muted);
    padding: var(--space-lg) var(--space-md);
    text-align: center;
    font-family: var(--font-body);
}

.site-footer p {
    font-size: 0.8rem;
    text-transform: uppercase;
    letter-spacing: 0.15em;
    margin-bottom: 0;
    opacity: 0.5;
}

/* Image fallback */
img {
    font-family: var(--font-body);
    font-weight: 300;
    line-height: 2;
    text-align: center;
    color: var(--text-muted);
}

img::before {
    content: "We're sorry, the image below is broken :(";
    display: block;
    margin-bottom: 10px;
}

img::after {
    content: "(url: " attr(src) ")";
    display: block;
    font-size: 12px;
}