/* Import Google Fonts */
@import url('https://fonts.googleapis.com/css2?family=Lato:wght@400;700&display=swap');
@import url('https://fonts.googleapis.com/css2?family=Merriweather:wght@400;700&display=swap');

/* Root color variables (richer, muted tones) */
:root {
    --green: #4A7C59;  /* muted forest green */
    --orange: #C55B18; /* warm burnt orange */
    --ink: #333333;    /* dark gray (near-black) */
}

/* Global typography and body styling */
body {
    font-family: 'Lato', sans-serif;
    line-height: 1.6;
    color: #333;
    margin: 0;
    padding: 0;
}
h1, h2, h3, h4 {
    font-family: 'Merriweather', serif;
    margin-top: 0;
}
h1 { font-size: 2.5rem; }
h2 { font-size: 1.75rem; margin-bottom: 1rem; }

/* Header/Hero */
.hero {
    text-align: center;
    padding: 3rem 1rem;
    position: relative;
    background: radial-gradient(circle at center, rgba(74, 124, 89, 0.05) 0%, transparent 70%);
}
.hero h1 {
    color: var(--green);
}

/* Card grid container */
.cards {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
    gap: 2rem;
    max-width: 1000px;
    margin: 2rem auto;
    padding: 0 1rem;
}

/* Individual card */
.card {
    display: block;
    background: #fff;
    border-radius: 8px;
    padding: 1.5rem;
    text-decoration: none;
    color: var(--ink);
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.08);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    /* Enable 3D-friendly transforms */
    transform: translateZ(0);
}
.card:hover {
    transform: translateY(-4px) scale(1.03);
    box-shadow: 0 6px 15px rgba(0, 0, 0, 0.15);
}

/* Accent border color by card type */
.card.green  { border-left: 5px solid var(--green); }
.card.orange { border-left: 5px solid var(--orange); }
.card.ink    { border-left: 5px solid var(--ink); }

/* Card content */
.card h2 {
    margin-top: 0;
    margin-bottom: 0.75rem;
    font-size: 1.25rem;
}
.card p {
    margin: 0;
    font-size: 0.95rem;
    color: #555;
}

/* Responsive tweaks (mobile-first) */
@media (max-width: 600px) {
    .hero h1 { font-size: 2rem; }
    .cards { grid-template-columns: 1fr; }
}

/* Welcome section styling */
.welcome-section {
    background-color: #fdfbf6;
    border-left: 5px solid var(--orange);
    padding: 2rem 1rem;
    margin: 3rem 1rem;
}
.welcome-section h2 {
    text-align: center;
    color: var(--ink);
}
.welcome-section p {
    max-width: 800px;
    margin: 1rem auto;
    color: #444;
    line-height: 1.6;
}

/* Footer */
.site-footer {
    background: var(--ink);
    color: #fff;
    text-align: center;
    padding: 2rem 1rem;
    margin-top: 3rem;
}
.site-footer a {
    color: #fff;
    text-decoration: underline;
}

/* Placeholder for 3D triskeles icon */

.card-icon {
  width: 48px;
  height: 48px;
  margin: 0 auto 0.75rem;
}
.card-icon img {
  width: 100%;
  height: 100%;
  display: block;
}
.standard-image {
  max-width: 800px;
  margin: 2rem auto;
  text-align: center;
}
.standard-image img {
  width: 100%;
  height: auto;
  border: 4px solid #fff;
  box-shadow: 0 4px 12px rgba(0,0,0,.35);
}
.standard-image figcaption {
  font-size: 0.9rem;
  color: #666;
  margin-top: 0.5rem;
}

/* Image gallery container - this creates the three-column layout */
.image-gallery {
    display: flex !important;
    flex-wrap: wrap !important;
    justify-content: space-between !important;
    gap: 1.5rem !important;
    max-width: 1200px !important;
    margin: 2rem auto !important;
    padding: 0 1rem !important;
    align-items: stretch !important;
}

/* Individual image cards */
.image-gallery figure {
    flex: 0 1 calc(33.333% - 1rem) !important; /* Force exactly 1/3 width minus gap */
    width: calc(33.333% - 1rem) !important;
    min-width: 280px !important;
    margin: 0 !important;
    text-align: center !important;
    background: #fff !important;
    border-radius: 8px !important;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.08) !important;
    overflow: hidden !important;
    display: flex !important;
    flex-direction: column !important;
    height: 500px !important;
}

/* Image container within each card */
.image-gallery .image-container {
    height: 350px; /* Fixed height for image area */
    display: flex;
    justify-content: center;
    align-items: center;
    border-bottom: 4px solid var(--green);
    background-color: #f0f0f0;
    flex-shrink: 0; /* Prevents shrinking */
}

/* Images themselves */
.image-gallery img {
    max-width: 100%;
    max-height: 100%;
    object-fit: contain; /* Maintains aspect ratio, no cropping */
    display: block;
}

/* Caption area */
.image-gallery figcaption {
    padding: 1rem;
    text-align: center;
    flex-grow: 1; /* Takes up remaining space in the card */
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

/* Title styling */
.image-gallery .image-title {
    font-family: 'Merriweather', serif;
    font-size: 1.1rem;
    font-weight: 700;
    color: var(--green);
    display: block;
}

/* Description styling */
.image-gallery .image-description {
    font-size: 0.9rem;
    color: #666;
    line-height: 1.4;
    display: block;
}

/* Responsive adjustments */
@media (max-width: 768px) {
    .image-gallery figure {
        flex: 1 1 45%; /* Two columns on medium screens */
        height: 350px; /* Smaller cards on medium screens */
    }
    .image-gallery .image-container {
        height: 220px;
    }
}

@media (max-width: 480px) {
    .image-gallery figure {
        flex: 1 1 90%; /* Single column on small screens */
        height: auto; /* Allow height to adjust on very small screens */
    }
    .image-gallery .image-container {
        height: 180px;
    }
}