/* 
   Liminal Light - Main Stylesheet
   A dark, minimalist theme for the poetry book website
*/

/* ===== CSS Variables ===== */
:root {
    /* Color Palette */
    --color-bg-primary: #0a1622;
    --color-bg-secondary: #152738;
    --color-accent: #d9b775;
    --color-text-primary: #f5f5f5;
    --color-text-secondary: #c5c5c5;
    --color-cta: #2a9d8f;
    --color-cta-hover: #3db9aa;
    
    /* Typography */
    --font-heading: 'Playfair Display', serif;
    --font-body: 'Open Sans', sans-serif;
    
    /* Spacing */
    --spacing-xs: 0.5rem;
    --spacing-sm: 1rem;
    --spacing-md: 2rem;
    --spacing-lg: 4rem;
    --spacing-xl: 8rem;
    
    /* Transitions */
    --transition-slow: 0.5s ease;
    --transition-medium: 0.3s ease;
    --transition-fast: 0.2s ease;
}

/* ===== Base Styles ===== */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    font-size: 16px;
    scroll-behavior: smooth;
}

body {
    font-family: var(--font-body);
    background-color: var(--color-bg-primary);
    color: var(--color-text-primary);
    line-height: 1.6;
    overflow-x: hidden;
}

h1, h2, h3, h4, h5, h6 {
    font-family: var(--font-heading);
    font-weight: 700;
    line-height: 1.2;
    margin-bottom: var(--spacing-md);
}

p {
    margin-bottom: var(--spacing-md);
}

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

a:hover {
    color: var(--color-text-primary);
}

.container {
    width: 90%;
    max-width: 1200px;
    margin: 0 auto;
    padding: var(--spacing-md) 0;
}

section {
    padding: var(--spacing-xl) 0;
}

/* ===== Header Styles ===== */
.header {
    min-height: 100svh;
    display: flex;
    align-items: center;
    justify-content: center;
    text-align: center;
    background-color: var(--color-bg-primary);
    background-image: linear-gradient(rgba(10, 22, 34, 0.8), rgba(10, 22, 34, 0.8)), var(--header-bg, url('../images/header-bg-000.jpg'));
    background-size: cover;
    background-position: center;
    position: relative;
}

.header-content {
    max-width: 800px;
    padding: 0 var(--spacing-md);
}

.title {
    font-size: 3.5rem;
    margin-bottom: var(--spacing-sm);
    color: var(--color-text-primary);
    letter-spacing: 2px;
    opacity: 0;
    animation: fadeIn 1.5s ease forwards;
}

.subtitle {
    font-size: 1.8rem;
    margin-bottom: var(--spacing-md);
    color: var(--color-text-secondary);
    font-weight: 400;
    opacity: 0;
    animation: fadeIn 1.5s ease 0.5s forwards;
}

.author {
    font-size: 1.2rem;
    color: var(--color-accent);
    letter-spacing: 1px;
    opacity: 0;
    animation: fadeIn 1.5s ease 1s forwards;
}



.arrow {
    display: block;
    width: 20px;
    height: 20px;
    border-right: 2px solid var(--color-accent);
    border-bottom: 2px solid var(--color-accent);
    transform: rotate(45deg);
}

/* ===== Introduction Section ===== */
.intro {
    background-color: var(--color-bg-secondary);
    text-align: center;
}

.intro-content {
    max-width: 800px;
    margin: 0 auto;
    font-size: 1.2rem;
    line-height: 1.8;
}

/* ===== Poetry Sections ===== */





.poem-title {
    text-align: center;
    font-size: 2.2rem;
    color: var(--color-accent);
    margin-bottom: var(--spacing-lg);
}

.poem-content {
    max-width: 700px;
    margin: 0 auto;
    font-size: 1.1rem;
    line-height: 2;
    white-space: pre-line;
}

.poem-placeholder {
    color: var(--color-text-secondary);
    font-style: italic;
    text-align: center;
}

/* ===== Gallery Section ===== */
.gallery {
    background-color: var(--color-bg-primary);
    text-align: center;
}

.section-title {
    font-size: 2.2rem;
    color: var(--color-accent);
}

.gallery-intro {
    max-width: 700px;
    margin: 0 auto var(--spacing-lg);
}

.gallery-container {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: var(--spacing-md);
    margin-top: var(--spacing-lg);
    grid-auto-rows: minmax(200px, auto);
}

.gallery-item {
    overflow: hidden;
    border-radius: 4px;
    position: relative;
    aspect-ratio: 1 / 1;
    background-color: var(--color-bg-secondary);
}

.gallery-item img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform var(--transition-medium);
    display: block;
}

.gallery-item.portrait {
    grid-row: span 2;
    aspect-ratio: 3 / 4;
}

.gallery-item.landscape {
    grid-column: span 2;
    aspect-ratio: 16 / 9;
}

.gallery-item.square {
    aspect-ratio: 1 / 1;
}

.gallery-item:hover img,
.gallery-item:focus img,
.gallery-item img.keyboard-focus {
    transform: scale(1.05);
}

.gallery-item.focused {
    outline: 2px solid var(--color-accent);
    outline-offset: 2px;
}

.image-caption {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    background: rgba(10, 22, 34, 0.7);
    color: var(--color-text-primary);
    padding: 0.8rem;
    font-family: var(--font-heading);
    font-size: 1rem;
    opacity: 0;
    transition: opacity var(--transition-medium);
    text-align: center;
}

.gallery-item:hover .image-caption,
.gallery-item:focus .image-caption,
.gallery-item.focused .image-caption {
    opacity: 1;
}

.image-placeholder {
    width: 100%;
    height: 100%;
    background-color: var(--color-bg-secondary);
    transition: transform var(--transition-medium);
}

.gallery-item:hover .image-placeholder {
    transform: scale(1.05);
}

/* ===== Call-to-Action Section ===== */
.cta {
    background-color: var(--color-bg-secondary);
    text-align: center;
    padding: var(--spacing-xl) 0;
}

.cta-text {
    max-width: 700px;
    margin: 0 auto var(--spacing-lg);
    font-size: 1.2rem;
}

.cta-button {
    display: inline-block;
    padding: var(--spacing-sm) var(--spacing-lg);
    background-color: var(--color-cta);
    color: var(--color-text-primary);
    font-size: 1.1rem;
    font-weight: 600;
    border-radius: 4px;
    transition: background-color var(--transition-fast), transform var(--transition-fast);
}

.cta-button:hover {
    background-color: var(--color-cta-hover);
    color: var(--color-text-primary);
    transform: translateY(-2px);
}

/* ===== Footer Section ===== */
.footer {
    background-color: var(--color-bg-primary);
    padding: var(--spacing-lg) 0;
    text-align: center;
}

.contact {
    margin-bottom: var(--spacing-md);
}

.reviews {
    margin-bottom: var(--spacing-md);
}

blockquote {
    font-style: italic;
    margin-bottom: var(--spacing-sm);
    color: var(--color-text-secondary);
}

cite {
    font-style: normal;
    color: var(--color-accent);
}

.copyright {
    font-size: 0.9rem;
    color: var(--color-text-secondary);
}

/* ===== Animations ===== */
@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes bounce {
    0%, 20%, 50%, 80%, 100% {
        transform: translateY(0);
    }
    40% {
        transform: translateY(-10px);
    }
    60% {
        transform: translateY(-5px);
    }
}

.fade-in {
    opacity: 0;
    transform: translateY(20px);
    transition: opacity 1s ease, transform 1s ease;
}

.fade-in.visible {
    opacity: 1;
    transform: translateY(0);
}

/* ===== Responsive Styles ===== */
@media (max-width: 1199px) {
    html {
        font-size: 15px;
    }
    
    .gallery-container {
        grid-template-columns: repeat(2, 1fr);
    }
    
    .gallery-item.landscape {
        grid-column: span 1;
    }
}

@media (max-width: 767px) {
    html {
        font-size: 14px;
    }
    
    .title {
        font-size: 2.8rem;
    }
    
    .subtitle {
        font-size: 1.5rem;
    }
    
    section {
        padding: var(--spacing-lg) 0;
    }
    
    .gallery-container {
        grid-template-columns: 1fr;
        grid-auto-rows: minmax(250px, auto);
    }
    
    .gallery-item.portrait,
    .gallery-item.landscape,
    .gallery-item.square {
        grid-column: span 1;
        grid-row: span 1;
    }
    
    .gallery-item.portrait {
        aspect-ratio: 3 / 4;
    }
    
    .gallery-item.landscape {
        aspect-ratio: 4 / 3;
    }
    
    .image-caption {
        opacity: 1;
        font-size: 0.9rem;
        padding: 0.6rem;
    }
}

@media (max-width: 480px) {
    .title {
        font-size: 2.2rem;
    }
    
    .subtitle {
        font-size: 1.2rem;
    }
    
    .container {
        width: 95%;
    }
}
.cta-image {
    display: block;
    max-width: 200px; /* Adjust as needed */
    width: 100%;
    height: auto;
    margin: var(--spacing-md) auto;
}

/* === Final merged .poetry-section rule === */
.poetry-section {
    position: relative;
    padding: var(--spacing-xl) 0;
    background-color: var(--color-bg-primary);
    margin-bottom: var(--spacing-xl);
    scroll-margin-top: var(--spacing-lg);
    z-index: 1;
    isolation: isolate;
}

/* ===== Poetry Section Backgrounds ===== */
#st-brelades {
    background-image: linear-gradient(rgba(10, 22, 34, 0.9), rgba(10, 22, 34, 0.9)), url('images/gallery/jersey.webp');
    background-size: cover;
    background-position: center;
    background-attachment: fixed;
}

#bamburgh-castle {
    background-image: linear-gradient(rgba(21, 39, 56, 0.9), rgba(21, 39, 56, 0.9)), url('images/gallery/bamburgh.webp');
    background-size: cover;
    background-position: center;
    background-attachment: fixed;
}

#sea-therapist {
    background-image: linear-gradient(rgba(10, 22, 34, 0.9), rgba(10, 22, 34, 0.9)), url('images/gallery/4-waves-fog-rocks.webp');
    background-size: cover;
    background-position: center;
    background-attachment: fixed;
}

.horizontal-gallery {
  display: flex;
  overflow-x: auto;
  scroll-snap-type: x mandatory;
  gap: var(--spacing-md);
  padding-bottom: var(--spacing-md);
  -webkit-overflow-scrolling: touch;
}

.gallery-card {
  flex: 0 0 auto;
  width: 300px;
  scroll-snap-align: start;
  background-color: var(--color-bg-secondary);
  border-radius: 8px;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  justify-content: flex-start;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.2);
}

.gallery-card img {
  width: 100%;
  height: auto;
  display: block;
}

.gallery-card figcaption {
  padding: 0.8rem;
  font-family: var(--font-heading);
  font-size: 1rem;
  color: var(--color-text-primary);
  text-align: center;
  flex-grow: 1;
}
/* Scrollbar styling for WebKit (Chrome, Safari, Edge) */
.horizontal-gallery::-webkit-scrollbar {
  height: 8px;
}

.horizontal-gallery::-webkit-scrollbar-track {
  background: transparent;
}

.horizontal-gallery::-webkit-scrollbar-thumb {
  background-color: var(--color-accent);
  border-radius: 4px;
  transition: background-color 0.3s ease;
}

.horizontal-gallery::-webkit-scrollbar-thumb:hover {
  background-color: var(--color-text-primary); /* Light pop on hover */
}

/* Scrollbar styling for Firefox */
.horizontal-gallery {
  scrollbar-width: thin;
  scrollbar-color: var(--color-accent) transparent;
}



/* Mobile portrait fix for scroll indicator */
@media (max-width: 480px) and (orientation: portrait) {
    
}

.scroll-indicator {
    position: absolute;
    bottom: env(safe-area-inset-bottom, 2rem);
    left: 50%;
    transform: translateX(-50%);
    opacity: 1;
    animation: bounce 2s infinite 1.5s;
    transition: opacity 0.5s ease;
    z-index: 10;
}
/* Enhanced Gallery Styles - Add these to your styles.css */

.horizontal-gallery {
  display: flex;
  overflow-x: auto;
  scroll-snap-type: x mandatory;
  gap: var(--spacing-lg); /* Increased gap for better breathing room */
  padding: var(--spacing-md) var(--spacing-md) var(--spacing-lg);
  -webkit-overflow-scrolling: touch;
  scroll-behavior: smooth;
}

.gallery-card {
  flex: 0 0 auto;
  width: 320px; /* Slightly wider for better proportions */
  scroll-snap-align: start;
  background-color: var(--color-bg-secondary);
  border-radius: 12px; /* More rounded corners for modern look */
  overflow: hidden;
  display: flex;
  flex-direction: column;
  justify-content: flex-start;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.4); /* Deeper, more dramatic shadow */
  transition: transform 0.3s ease, box-shadow 0.3s ease;
  border: 1px solid rgba(217, 183, 117, 0.1); /* Subtle accent border */
}

.gallery-card:hover {
  transform: translateY(-8px) scale(1.02); /* Lift and slight scale on hover */
  box-shadow: 0 16px 32px rgba(0, 0, 0, 0.6);
  border-color: rgba(217, 183, 117, 0.3);
}

.gallery-card img {
  width: 100%;
  height: 240px; /* Fixed height for consistency */
  object-fit: cover; /* Ensures proper cropping */
  display: block;
  transition: transform 0.4s ease;
}

.gallery-card:hover img {
  transform: scale(1.08); /* Subtle zoom on image hover */
}

.gallery-card figcaption {
  padding: 1.2rem; /* More generous padding */
  font-family: var(--font-heading);
  font-size: 1rem;
  color: var(--color-text-primary);
  text-align: center;
  flex-grow: 1;
  background: linear-gradient(135deg, 
    var(--color-bg-secondary) 0%, 
    rgba(21, 39, 56, 0.8) 100%); /* Subtle gradient background */
  position: relative;
}

/* Add a subtle top border to captions */
.gallery-card figcaption::before {
  content: '';
  position: absolute;
  top: 0;
  left: 20%;
  right: 20%;
  height: 2px;
  background: linear-gradient(90deg, 
    transparent 0%, 
    var(--color-accent) 50%, 
    transparent 100%);
}

/* Enhanced scrollbar styling */
.horizontal-gallery::-webkit-scrollbar {
  height: 12px;
}

.horizontal-gallery::-webkit-scrollbar-track {
  background: rgba(10, 22, 34, 0.5);
  border-radius: 6px;
}

.horizontal-gallery::-webkit-scrollbar-thumb {
  background: linear-gradient(90deg, var(--color-accent), var(--color-cta));
  border-radius: 6px;
  border: 2px solid var(--color-bg-primary);
}

.horizontal-gallery::-webkit-scrollbar-thumb:hover {
  background: linear-gradient(90deg, var(--color-cta), var(--color-accent));
}

/* Add fade effect at edges to indicate scrollability */
.gallery::before,
.gallery::after {
  content: '';
  position: absolute;
  top: 0;
  bottom: 0;
  width: 40px;
  pointer-events: none;
  z-index: 2;
}

.gallery {
  position: relative;
}

.gallery::before {
  left: 0;
  background: linear-gradient(90deg, var(--color-bg-primary) 0%, transparent 100%);
}

.gallery::after {
  right: 0;
  background: linear-gradient(270deg, var(--color-bg-primary) 0%, transparent 100%);
}

/* Mobile improvements */
@media (max-width: 768px) {
  .gallery-card {
    width: 280px;
  }
  
  .gallery-card img {
    height: 200px;
  }
  
  .horizontal-gallery {
    gap: var(--spacing-md);
    padding: var(--spacing-sm) var(--spacing-sm) var(--spacing-md);
  }
  
  .gallery-card figcaption {
    padding: 1rem;
    font-size: 0.9rem;
  }
}
.gallery-card.selected {
  transform: scale(1.05);
  outline: 3px solid var(--color-accent);
  z-index: 2;
  transition: transform 0.3s ease, outline 0.3s ease;
}
/* === Lightbox Overlay === */
.lightbox-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(10, 22, 34, 0.95);
  display: flex;
  justify-content: center;
  align-items: center;
  z-index: 9999;
  padding: 2rem;
  box-sizing: border-box;
  cursor: zoom-out;
}

.lightbox-image {
  max-width: 90%;
  max-height: 90%;
  border-radius: 8px;
  box-shadow: 0 0 20px rgba(0,0,0,0.5);
}
