/* --- Palette ---
   cream      #faf6f0   page surface
   lavender   #c9b8dc   primary accent
   plum       #6d4f8f   mid purple
   aubergine  #3e2d4c   deep text
   sage       #9db28b   secondary accent
   blossom    #ead8f0   highlight wash
*/

:root {
    --cream: #faf6f0;
    --lavender: #c9b8dc;
    --plum: #6d4f8f;
    --aubergine: #3e2d4c;
    --sage: #9db28b;
    --blossom: #ead8f0;
    --card-bg: #fdfbf7;
}

* { box-sizing: border-box; }

body {
    margin: 0;
    padding: 0;
    font-family: 'Lora', 'Cormorant Garamond', Georgia, serif;
    color: var(--aubergine);
    background: var(--cream);
    line-height: 1.6;
}

/* --- Background layer (lavender field, softened) --- */
.page-background {
    position: relative;
    min-height: 100vh;
    padding: 80px 24px 120px;
}

.page-background::before {
    content: "";
    position: fixed;
    inset: 0;
    background-image:
        linear-gradient(180deg, rgba(250, 246, 240, 0.55) 0%, rgba(250, 246, 240, 0.85) 100%),
        url("../images/decorations/lavender_field.jpg");
    background-size: cover;
    background-position: center;
    filter: saturate(0.85);
    z-index: -1;
}

.content-container {
    max-width: 1180px;
    margin: 0 auto;
}

/* --- Header / title --- */
header {
    text-align: center;
    padding: 40px 20px 80px;
}

.title-frame {
    display: inline-block;
    padding: 28px 56px;
    background: rgba(253, 251, 247, 0.7);
    border: 1px solid var(--lavender);
    border-radius: 4px;
    box-shadow:
        0 1px 0 rgba(255, 255, 255, 0.8) inset,
        0 12px 40px rgba(62, 45, 76, 0.12);
    backdrop-filter: blur(6px);
    position: relative;
}

.title-frame::before,
.title-frame::after {
    content: "";
    position: absolute;
    left: 50%;
    transform: translateX(-50%);
    width: 80px;
    height: 1px;
    background: var(--sage);
    opacity: 0.6;
}
.title-frame::before { top: 14px; }
.title-frame::after  { bottom: 14px; }

header h1 {
    font-family: 'Cormorant Garamond', Georgia, serif;
    font-weight: 600;
    font-size: clamp(2.5rem, 5vw, 4rem);
    letter-spacing: 0.02em;
    margin: 0;
    color: var(--aubergine);
}

header .tagline {
    margin-top: 18px;
    font-family: 'Cormorant Garamond', serif;
    font-style: italic;
    font-size: 1.2rem;
    color: var(--plum);
    letter-spacing: 0.04em;
}

/* --- Pet grid --- */
.pet-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 56px 40px;
    padding: 20px 0;
}

.animal-card {
    text-align: center;
    opacity: 0;
    transform: translateY(20px);
}

.animal-card a {
    display: block;
    text-decoration: none;
    color: inherit;
}

/* --- Photo + slide-up bio overlay --- */
.photo-frame {
    position: relative;
    width: 240px;
    height: 240px;
    margin: 0 auto;
    border-radius: 50%;
    overflow: hidden;
    border: 6px solid var(--card-bg);
    box-shadow:
        0 0 0 1px var(--lavender),
        0 14px 30px rgba(62, 45, 76, 0.18);
    transition: transform 0.4s ease, box-shadow 0.4s ease;
}

.photo-frame img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
    transition: transform 0.6s ease, filter 0.4s ease;
}

.bio-overlay {
    position: absolute;
    left: 0;
    right: 0;
    bottom: 0;
    padding: 22px 18px 20px;
    background: linear-gradient(
        180deg,
        rgba(62, 45, 76, 0) 0%,
        rgba(62, 45, 76, 0.78) 35%,
        rgba(62, 45, 76, 0.92) 100%
    );
    color: var(--cream);
    font-family: 'Cormorant Garamond', serif;
    font-size: 1.05rem;
    line-height: 1.4;
    transform: translateY(100%);
    transition: transform 0.45s cubic-bezier(0.2, 0.7, 0.2, 1);
    text-align: center;
}

.bio-overlay .bio-hint {
    display: block;
    margin-top: 10px;
    font-size: 0.78rem;
    letter-spacing: 0.18em;
    text-transform: uppercase;
    color: var(--lavender);
    font-family: 'Lora', serif;
    font-style: normal;
}

.animal-card a:hover .photo-frame,
.animal-card a:focus-visible .photo-frame {
    transform: translateY(-4px);
    box-shadow:
        0 0 0 1px var(--plum),
        0 0 32px rgba(201, 184, 220, 0.6),
        0 20px 40px rgba(62, 45, 76, 0.25);
}

.animal-card a:hover .photo-frame img,
.animal-card a:focus-visible .photo-frame img {
    transform: scale(1.06);
    filter: brightness(0.92);
}

.animal-card a:hover .bio-overlay,
.animal-card a:focus-visible .bio-overlay {
    transform: translateY(0);
}

.animal-name {
    margin-top: 22px;
    font-family: 'Cormorant Garamond', serif;
    font-weight: 600;
    font-size: 2.1rem;
    color: var(--aubergine);
    letter-spacing: 0.03em;
}

.animal-name::after {
    content: "";
    display: block;
    width: 28px;
    height: 1px;
    margin: 10px auto 0;
    background: var(--sage);
    opacity: 0.7;
}

/* --- Detail page --- */
.detail-page {
    max-width: 760px;
    margin: 0 auto;
}

.back-link {
    display: inline-block;
    margin-bottom: 30px;
    font-family: 'Cormorant Garamond', serif;
    font-style: italic;
    color: var(--plum);
    text-decoration: none;
    letter-spacing: 0.04em;
}
.back-link:hover { color: var(--aubergine); }

.detail-card {
    background: var(--card-bg);
    border: 1px solid var(--lavender);
    border-radius: 6px;
    padding: 56px 48px;
    box-shadow: 0 18px 50px rgba(62, 45, 76, 0.15);
    text-align: center;
}

.detail-photo {
    width: 280px;
    height: 280px;
    object-fit: cover;
    border-radius: 50%;
    border: 8px solid var(--card-bg);
    box-shadow: 0 0 0 1px var(--lavender), 0 12px 28px rgba(62, 45, 76, 0.18);
    margin-bottom: 30px;
}

.detail-name {
    font-family: 'Cormorant Garamond', serif;
    font-weight: 600;
    font-size: 3rem;
    margin: 0 0 8px;
    color: var(--aubergine);
}

.detail-divider {
    width: 60px;
    height: 1px;
    background: var(--sage);
    margin: 18px auto 28px;
    opacity: 0.7;
}

.detail-bio {
    font-size: 1.15rem;
    line-height: 1.75;
    color: var(--aubergine);
    text-align: left;
    max-width: 56ch;
    margin: 0 auto;
}

.gallery-heading {
    margin-top: 56px;
    margin-bottom: 20px;
    font-family: 'Cormorant Garamond', serif;
    font-weight: 600;
    font-size: 1.6rem;
    letter-spacing: 0.05em;
    color: var(--plum);
    text-align: center;
}

.gallery-heading::after {
    content: "";
    display: block;
    width: 40px;
    height: 1px;
    background: var(--sage);
    margin: 12px auto 0;
    opacity: 0.7;
}

.gallery {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 16px;
}

.gallery-thumb {
    padding: 0;
    border: none;
    background: none;
    cursor: pointer;
    border-radius: 4px;
    overflow: hidden;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    box-shadow: 0 6px 18px rgba(62, 45, 76, 0.15);
}

.gallery-thumb:hover,
.gallery-thumb:focus-visible {
    transform: translateY(-3px);
    box-shadow: 0 10px 24px rgba(62, 45, 76, 0.25);
    outline: none;
}

.gallery-thumb img {
    width: 100%;
    height: 180px;
    object-fit: cover;
    display: block;
}

/* --- Lightbox --- */
.lightbox {
    position: fixed;
    inset: 0;
    background: rgba(20, 12, 28, 0.92);
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.25s ease;
    z-index: 100;
    padding: 40px;
    cursor: zoom-out;
}

.lightbox.open {
    opacity: 1;
    pointer-events: auto;
}

.lightbox img {
    max-width: 100%;
    max-height: 100%;
    object-fit: contain;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.6);
    border-radius: 4px;
}

#lightbox-close {
    position: absolute;
    top: 24px;
    right: 28px;
    width: 44px;
    height: 44px;
    background: transparent;
    color: var(--cream);
    border: 1px solid rgba(250, 246, 240, 0.4);
    border-radius: 50%;
    font-size: 1.6rem;
    line-height: 1;
    cursor: pointer;
    transition: background 0.2s ease, border-color 0.2s ease;
}

#lightbox-close:hover {
    background: rgba(250, 246, 240, 0.12);
    border-color: var(--cream);
}

/* --- Fade-in animation --- */
.fade-in {
    animation: fadeInUp 1.1s ease forwards;
}

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

/* --- Responsive --- */
@media (max-width: 600px) {
    .page-background { padding: 40px 16px 80px; }
    header { padding: 20px 10px 50px; }
    .title-frame { padding: 22px 28px; }
    .photo-frame { width: 200px; height: 200px; }
    .detail-card { padding: 36px 24px; }
}
