/* =========================================================
   S. T. GOMIS — sitio web oficial
   Diseño editorial literario oscuro
   ========================================================= */

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

html {
    font-size: 18px;
    scroll-behavior: smooth;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

body {
    font-family: 'Inter', -apple-system, system-ui, sans-serif;
    background: #0d0d0d;
    color: #e8e4dc;
    line-height: 1.65;
    min-height: 100vh;
    position: relative;
    overflow-x: hidden;
}

/* Textura sutil para dar atmósfera al negro */
body::before {
    content: '';
    position: fixed;
    top: 0; left: 0; right: 0; bottom: 0;
    background-image:
        radial-gradient(ellipse at top, rgba(212, 160, 90, 0.035), transparent 50%),
        radial-gradient(ellipse at bottom, rgba(80, 60, 100, 0.02), transparent 50%);
    pointer-events: none;
    z-index: 0;
}

/* Ruido tipográfico muy sutil */
body::after {
    content: '';
    position: fixed;
    top: 0; left: 0; right: 0; bottom: 0;
    background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 200 200' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.85' numOctaves='2' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)' opacity='0.35'/%3E%3C/svg%3E");
    pointer-events: none;
    z-index: 1;
    opacity: 0.03;
    mix-blend-mode: overlay;
}

main, header, footer {
    position: relative;
    z-index: 2;
}

/* -----------------
   Tipografía
   ----------------- */
.serif, h1, h2, h3, .book-title, .hero-title, .author-quote {
    font-family: 'Cormorant Garamond', Georgia, serif;
    font-weight: 400;
    letter-spacing: -0.01em;
}

em, i {
    font-style: italic;
}

/* -----------------
   Layout principal
   ----------------- */
.container {
    max-width: 680px;
    margin: 0 auto;
    padding: 0 2rem;
}

main {
    padding: 3rem 0 6rem;
}

/* -----------------
   Header: nombre autor + selector idioma
   ----------------- */
.site-header {
    position: sticky;
    top: 0;
    background: rgba(13, 13, 13, 0.88);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border-bottom: 1px solid rgba(232, 228, 220, 0.08);
    padding: 1.25rem 0;
    z-index: 100;
}

.site-header .container {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 1rem;
}

.brand {
    font-family: 'Cormorant Garamond', serif;
    font-size: 1.2rem;
    font-weight: 500;
    letter-spacing: 0.02em;
    color: #e8e4dc;
    text-decoration: none;
    transition: color 0.2s ease;
}

.brand:hover {
    color: #d4a05a;
}

/* -----------------
   Selector de idioma
   ----------------- */
.lang-switcher {
    position: relative;
}

.lang-button {
    background: transparent;
    border: 1px solid rgba(232, 228, 220, 0.15);
    color: #e8e4dc;
    font-family: 'Inter', sans-serif;
    font-size: 0.82rem;
    letter-spacing: 0.04em;
    padding: 0.5rem 0.9rem;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    border-radius: 2px;
    transition: all 0.2s ease;
}

.lang-button:hover {
    border-color: rgba(212, 160, 90, 0.5);
    color: #d4a05a;
}

.lang-button .chevron {
    width: 10px;
    height: 10px;
    transition: transform 0.2s ease;
    opacity: 0.7;
}

.lang-switcher.open .chevron {
    transform: rotate(180deg);
}

.lang-dropdown {
    position: absolute;
    top: calc(100% + 0.5rem);
    right: 0;
    background: #0d0d0d;
    border: 1px solid rgba(232, 228, 220, 0.12);
    border-radius: 2px;
    min-width: 220px;
    max-height: 420px;
    overflow-y: auto;
    opacity: 0;
    visibility: hidden;
    transform: translateY(-8px);
    transition: opacity 0.2s ease, transform 0.2s ease, visibility 0.2s ease;
    box-shadow: 0 20px 40px -10px rgba(0, 0, 0, 0.6);
    z-index: 200;
}

.lang-switcher.open .lang-dropdown {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.lang-dropdown::-webkit-scrollbar {
    width: 6px;
}

.lang-dropdown::-webkit-scrollbar-track {
    background: transparent;
}

.lang-dropdown::-webkit-scrollbar-thumb {
    background: rgba(212, 160, 90, 0.3);
    border-radius: 3px;
}

.lang-option {
    display: block;
    padding: 0.7rem 1rem;
    color: #e8e4dc;
    text-decoration: none;
    font-size: 0.88rem;
    letter-spacing: 0.01em;
    border-bottom: 1px solid rgba(232, 228, 220, 0.05);
    transition: all 0.15s ease;
    font-family: 'Inter', sans-serif;
}

.lang-option:last-child {
    border-bottom: none;
}

.lang-option:hover {
    background: rgba(212, 160, 90, 0.08);
    color: #d4a05a;
    padding-left: 1.25rem;
}

.lang-option.current {
    color: #d4a05a;
    background: rgba(212, 160, 90, 0.05);
}

.lang-option .lang-name {
    display: block;
}

.lang-option .lang-code {
    font-size: 0.7rem;
    opacity: 0.5;
    letter-spacing: 0.1em;
    text-transform: uppercase;
}

/* -----------------
   Hero
   ----------------- */
.hero {
    padding: 5rem 0 4rem;
    text-align: center;
}

.hero-title {
    font-size: clamp(3rem, 8vw, 5rem);
    line-height: 1;
    margin-bottom: 1.5rem;
    color: #e8e4dc;
    font-weight: 400;
}

.hero-tagline {
    font-family: 'Cormorant Garamond', serif;
    font-style: italic;
    font-size: clamp(1.1rem, 2.5vw, 1.4rem);
    line-height: 1.5;
    color: #b8b3a9;
    max-width: 560px;
    margin: 0 auto;
}

/* -----------------
   Divisor sutil
   ----------------- */
.divider {
    width: 60px;
    height: 1px;
    background: rgba(212, 160, 90, 0.4);
    margin: 3rem auto;
    border: none;
}

/* -----------------
   Sección del libro
   ----------------- */
.book-section {
    padding: 2rem 0;
    display: grid;
    grid-template-columns: 240px 1fr;
    gap: 3rem;
    align-items: start;
}

.book-cover {
    position: relative;
    aspect-ratio: 5/8;
    background: #1a1a1a;
    overflow: hidden;
    border: 1px solid rgba(212, 160, 90, 0.1);
    box-shadow: 0 20px 40px -10px rgba(0, 0, 0, 0.8);
}

.book-cover img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.book-details {
    padding-top: 0.5rem;
}

.book-label {
    font-size: 0.72rem;
    letter-spacing: 0.2em;
    text-transform: uppercase;
    color: #d4a05a;
    margin-bottom: 0.75rem;
    font-weight: 500;
}

.book-saga {
    font-family: 'Cormorant Garamond', serif;
    font-style: italic;
    font-size: 1rem;
    color: #b8b3a9;
    margin-bottom: 0.5rem;
}

.book-title {
    font-size: clamp(2rem, 4.5vw, 2.8rem);
    line-height: 1.05;
    margin-bottom: 1.5rem;
    color: #e8e4dc;
    font-weight: 400;
}

.book-synopsis {
    font-size: 0.98rem;
    line-height: 1.7;
    color: #c8c3b9;
    margin-bottom: 2rem;
}

.book-cta {
    display: inline-block;
    padding: 0.85rem 1.75rem;
    border: 1px solid rgba(212, 160, 90, 0.6);
    color: #d4a05a;
    text-decoration: none;
    font-family: 'Inter', sans-serif;
    font-size: 0.85rem;
    letter-spacing: 0.15em;
    text-transform: uppercase;
    transition: all 0.25s ease;
    background: transparent;
    cursor: pointer;
}

.book-cta:hover {
    background: rgba(212, 160, 90, 0.1);
    border-color: #d4a05a;
    transform: translateY(-2px);
}

.book-cta.coming-soon {
    border-color: rgba(232, 228, 220, 0.2);
    color: rgba(232, 228, 220, 0.5);
    cursor: default;
    pointer-events: none;
}

.book-cta.coming-soon:hover {
    background: transparent;
    transform: none;
}

/* -----------------
   Sección autor
   ----------------- */
.author-section {
    padding: 2rem 0;
    text-align: center;
}

.author-photo {
    width: 160px;
    height: 160px;
    border-radius: 50%;
    object-fit: cover;
    margin: 0 auto 2rem;
    border: 2px solid rgba(212, 160, 90, 0.2);
    filter: grayscale(15%);
    box-shadow: 0 15px 30px -5px rgba(0, 0, 0, 0.6);
}

.author-label {
    font-size: 0.72rem;
    letter-spacing: 0.2em;
    text-transform: uppercase;
    color: #d4a05a;
    margin-bottom: 1.5rem;
    font-weight: 500;
}

.author-quote {
    font-family: 'Cormorant Garamond', serif;
    font-style: italic;
    font-size: clamp(1.1rem, 2.2vw, 1.3rem);
    line-height: 1.55;
    color: #e8e4dc;
    max-width: 560px;
    margin: 0 auto 2rem;
}

.author-bio {
    font-size: 0.95rem;
    line-height: 1.75;
    color: #c8c3b9;
    max-width: 560px;
    margin: 0 auto;
    text-align: left;
}

.author-bio p {
    margin-bottom: 1.1rem;
}

.author-bio p:last-child {
    margin-bottom: 0;
}

.author-bio strong {
    color: #e8e4dc;
    font-weight: 500;
}

.author-postscript {
    font-family: 'Cormorant Garamond', serif;
    font-size: 1rem;
    line-height: 1.6;
    color: #a8a39a;
    max-width: 500px;
    margin: 2.5rem auto 0;
    text-align: center;
    padding-top: 2rem;
    border-top: 1px solid rgba(232, 228, 220, 0.08);
}

.author-postscript em {
    font-style: italic;
}

/* -----------------
   Footer
   ----------------- */
.site-footer {
    padding: 3rem 0;
    border-top: 1px solid rgba(232, 228, 220, 0.08);
    margin-top: 4rem;
    text-align: center;
    position: relative;
    z-index: 2;
}

.footer-email {
    font-family: 'Cormorant Garamond', serif;
    font-style: italic;
    font-size: 1rem;
    color: #d4a05a;
    text-decoration: none;
    border-bottom: 1px solid transparent;
    transition: border-color 0.2s ease;
}

.footer-email:hover {
    border-bottom-color: #d4a05a;
}

.footer-copyright {
    font-size: 0.78rem;
    color: rgba(232, 228, 220, 0.4);
    letter-spacing: 0.1em;
    margin-top: 1.5rem;
}

/* -----------------
   Animación de entrada
   ----------------- */
@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(12px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.hero, .book-section, .author-section, .site-footer {
    animation: fadeInUp 0.8s ease-out both;
}

.book-section { animation-delay: 0.1s; }
.author-section { animation-delay: 0.2s; }
.site-footer { animation-delay: 0.3s; }

/* -----------------
   Responsive mobile-first
   ----------------- */
@media (max-width: 720px) {
    html {
        font-size: 16px;
    }

    .container {
        padding: 0 1.5rem;
    }

    .hero {
        padding: 3rem 0 2.5rem;
    }

    .book-section {
        grid-template-columns: 1fr;
        gap: 2rem;
        text-align: center;
    }

    .book-cover {
        max-width: 200px;
        margin: 0 auto;
    }

    .book-details {
        padding-top: 0;
    }

    .book-synopsis, .author-bio {
        text-align: left;
    }

    .lang-dropdown {
        right: 0;
        max-height: 320px;
    }

    .author-photo {
        width: 130px;
        height: 130px;
    }

    .divider {
        margin: 2rem auto;
    }
}

@media (max-width: 400px) {
    .hero-title {
        font-size: 2.5rem;
    }

    .book-title {
        font-size: 1.8rem;
    }
}

/* -----------------
   RTL — Hebreo
   ----------------- */
[dir="rtl"] {
    text-align: right;
}

[dir="rtl"] .site-header .container {
    flex-direction: row-reverse;
}

[dir="rtl"] .book-section {
    grid-template-columns: 1fr 240px;
}

[dir="rtl"] .book-details {
    text-align: right;
}

[dir="rtl"] .author-bio {
    text-align: right;
}

[dir="rtl"] .author-postscript {
    text-align: center;
}

[dir="rtl"] .lang-dropdown {
    right: auto;
    left: 0;
}

[dir="rtl"] .lang-option:hover {
    padding-left: 1rem;
    padding-right: 1.25rem;
}

@media (max-width: 720px) {
    [dir="rtl"] .book-section {
        grid-template-columns: 1fr;
    }
}

/* -----------------
   Mejoras accesibilidad
   ----------------- */
:focus-visible {
    outline: 2px solid #d4a05a;
    outline-offset: 4px;
}

@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after {
        animation-duration: 0.01ms !important;
        transition-duration: 0.01ms !important;
    }
}

/* -----------------
   Redes sociales — header (solo Instagram)
   ----------------- */
.brand-group {
    display: flex;
    align-items: center;
    gap: 0.85rem;
}

.brand-social {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 28px;
    height: 28px;
    color: #b8b3a9;
    border-radius: 50%;
    transition: color 0.2s ease, transform 0.2s ease;
}

.brand-social:hover {
    color: #d4a05a;
    transform: translateY(-1px);
}

.brand-social svg {
    width: 18px;
    height: 18px;
    display: block;
}

/* -----------------
   Redes sociales — footer
   ----------------- */
.footer-social {
    display: flex;
    justify-content: center;
    gap: 1.25rem;
    margin: 1.25rem 0 0.25rem;
}

.footer-social a {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    color: #8a857c;
    border: 1px solid rgba(232, 228, 220, 0.1);
    border-radius: 50%;
    transition: color 0.2s ease, border-color 0.2s ease, transform 0.2s ease;
}

.footer-social a:hover {
    color: #d4a05a;
    border-color: rgba(212, 160, 90, 0.35);
    transform: translateY(-1px);
}

.footer-social svg {
    width: 16px;
    height: 16px;
    display: block;
}

@media (max-width: 400px) {
    .footer-social { gap: 1rem; }
    .footer-social a { width: 34px; height: 34px; }
}
