html {
    scroll-behavior: smooth;
}

body {
    font-family: 'Lato', 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    margin: 0;
    background-color: #f8f9fa;
    color: #343a40;
    text-align: center;
    margin-top: 1rem;
}

header {
    background: linear-gradient(rgba(0, 0, 0, 0.6), rgba(0, 0, 0, 0.6)), url('rescue2.png');
    background-size: cover;
    background-position: center;
    color: #fff;
    padding: 5rem 1rem;
    margin-bottom: 3rem;
    text-shadow: 2px 2px 8px rgba(0,0,0,0.7);
}

header .header-content {
    max-width: 800px;
    margin: 0 auto;
}

header h1 {
    margin: 0;
    font-family: 'Montserrat', sans-serif;
    font-size: 3.5rem;
}

header p {
    font-size: 1.3rem;
    color: #e9ecef;
    margin-top: 1rem;
}

main {
    padding: 0 1rem;
}

nav#page-index {
    background-color: #fff;
    padding: 1rem;
    margin-bottom: 3rem;
    box-shadow: 0 2px 5px rgba(0,0,0,0.1);
    position: sticky;
    top: 0;
    z-index: 500;
}

nav#page-index ul {
    list-style: none;
    padding: 0;
    margin: 0;
    display: flex;
    justify-content: center;
    gap: 1.5rem;
    flex-wrap: wrap;
}

nav#page-index a {
    text-decoration: none;
    color: #343a40;
    font-weight: 700;
    font-family: 'Lato', sans-serif;
    padding: 0.5rem 1rem;
    border-radius: 5px;
    transition: background-color 0.3s ease, color 0.3s ease;
}

nav#page-index a:hover {
    background-color: #e9ecef;
    color: #000;
}

#gallery {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(350px, 1fr));
    gap: 1.5rem;
    max-width: 1400px;
    margin: 0 auto;
}

.gallery-item {
    position: relative;
    background-color: #fff;
    border-radius: 8px;
    box-shadow: 0 4px 8px rgba(0,0,0,0.05);
    overflow: hidden;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    text-align: left;
    cursor: pointer;
}

.gallery-item:hover {
    transform: translateY(-5px);
    box-shadow: 0 12px 24px rgba(0,0,0,0.1);
}

.photo-number {
    position: absolute;
    top: 10px;
    left: 10px;
    background-color: rgba(255, 255, 255, 0.9);
    color: #333;
    width: 32px;
    height: 32px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: bold;
    font-size: 1rem;
    z-index: 1;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

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

.gallery-item .caption {
    padding: 1rem 1.25rem;
    font-size: 0.9rem;
    color: #555;
    line-height: 1.4;
    font-style: italic;
    background-color: #f8f9fa;
    border-top: 1px solid #e9ecef;
}

/* Hero Dog Stories Section */
#hero-dog-stories, #human-hero-story, #did-you-know, #dog-jobs, #dog-debate {
    padding: 3rem 1rem;
    display: flex;
    justify-content: center;
    align-items: center;
    margin-bottom: 2rem;
}

#human-hero-story, #did-you-know, #dog-jobs {
    margin-top: -2rem; /* Reduce space between post-its */
    padding-top: 0;
}

.story-content {
    background: #ffc;
    color: #333;
    padding: 2rem;
    max-width: 650px;
    box-shadow: 5px 5px 15px rgba(0,0,0,0.2);
    transform: rotate(-2deg);
    transition: transform 0.3s ease;
    font-family: 'Indie Flower', cursive;
    text-align: left;
    line-height: 1.6;
}

.story-content:hover {
    transform: rotate(0deg) scale(1.02);
}

.story-content h2 {
    font-family: 'Indie Flower', cursive;
    font-size: 2.8rem;
    margin-top: 0;
    margin-bottom: 1rem;
    text-align: center;
    color: #000;
}

.story-content p {
    font-size: 1.4rem;
    margin-bottom: 1.2em;
}

.story-content strong {
    color: #555;
}

/* Debate Section */
#dog-debate {
    margin-top: -2rem;
    padding-top: 0;
}

.story-content-debate {
    background: #ffe5d9; /* Light peach */
    color: #333;
    padding: 2rem;
    max-width: 800px; /* Wider for the table */
    width: 100%;
    box-shadow: 5px 5px 15px rgba(0,0,0,0.2);
    transform: rotate(1.8deg);
    transition: transform 0.3s ease;
    font-family: 'Indie Flower', cursive;
    text-align: left;
    line-height: 1.5;
}

.story-content-debate:hover {
    transform: rotate(0deg) scale(1.02);
}

.story-content-debate h2 {
    font-family: 'Indie Flower', cursive;
    font-size: 2.5rem;
    margin-top: 0;
    margin-bottom: 1.5rem;
    text-align: center;
    color: #000;
}

.story-content-debate table {
    width: 100%;
    border-collapse: collapse;
    font-size: 1.2rem;
    margin-bottom: 1.5rem;
}

.story-content-debate th,
.story-content-debate td {
    border: 2px dashed #333;
    padding: 0.75rem;
    vertical-align: top;
}

.story-content-debate th {
    font-size: 1.5rem;
    text-align: center;
    background-color: rgba(0,0,0,0.05);
}

.story-content-debate .key-differences {
    font-family: 'Indie Flower', cursive;
    font-size: 1.8rem;
    text-align: center;
    margin-top: 2rem;
    color: #444;
}

/* Human Hero Story Section */
.story-content-human {
    background: #d4eaff; /* Different color post-it */
    color: #333;
    padding: 2rem;
    max-width: 650px;
    box-shadow: 5px 5px 15px rgba(0,0,0,0.2);
    transform: rotate(1.5deg); /* Different rotation */
    transition: transform 0.3s ease;
    font-family: 'Indie Flower', cursive;
    text-align: left;
    line-height: 1.6;
}

.story-content-human:hover {
    transform: rotate(0deg) scale(1.02);
}

.story-content-human h2 {
    font-family: 'Indie Flower', cursive;
    font-size: 2.8rem;
    margin-top: 0;
    margin-bottom: 1rem;
    text-align: center;
    color: #000;
}

.story-content-human p {
    font-size: 1.4rem;
    margin-bottom: 1.2em;
}

/* Did You Know Section */
.story-content-facts {
    background: #e2ffc4; /* Light green post-it */
    color: #333;
    padding: 2rem;
    max-width: 650px;
    box-shadow: 5px 5px 15px rgba(0,0,0,0.2);
    transform: rotate(-1deg); /* Different rotation */
    transition: transform 0.3s ease;
    font-family: 'Indie Flower', cursive;
    text-align: left;
    line-height: 1.6;
}

.story-content-facts:hover {
    transform: rotate(0deg) scale(1.02);
}

.story-content-facts h2 {
    font-family: 'Indie Flower', cursive;
    font-size: 2.8rem;
    margin-top: 0;
    margin-bottom: 1rem;
    text-align: center;
    color: #000;
}

.story-content-facts p {
    font-size: 1.4rem;
    margin-bottom: 1.2em;
}

/* Dog Jobs Section */
.story-content-jobs {
    background: #e8dfff; /* Light purple post-it */
    color: #333;
    padding: 2rem;
    max-width: 650px;
    box-shadow: 5px 5px 15px rgba(0,0,0,0.2);
    transform: rotate(1.2deg); /* Different rotation */
    transition: transform 0.3s ease;
    font-family: 'Indie Flower', cursive;
    text-align: left;
    line-height: 1.6;
}

.story-content-jobs:hover {
    transform: rotate(0deg) scale(1.02);
}

.story-content-jobs h2 {
    font-family: 'Indie Flower', cursive;
    font-size: 2.8rem;
    margin-top: 0;
    margin-bottom: 1rem;
    text-align: center;
    color: #000;
}

.story-content-jobs h2.sub-heading {
    font-size: 2.4rem;
    margin-top: 2.5rem;
}

.story-content-jobs h3 {
    font-family: 'Indie Flower', cursive;
    font-size: 1.8rem;
    margin-top: 1.5rem;
    margin-bottom: 0.5rem;
    color: #444;
}

.story-content-jobs ul {
    font-size: 1.4rem;
    margin-bottom: 1.2em;
    padding-left: 2rem;
    list-style-type: '🐾 ';
}

.story-content-jobs li {
    padding-left: 0.5rem;
    margin-bottom: 0.5em;
}

/* Modal Styles */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.85);
    display: none;
    align-items: center;
    justify-content: center;
    z-index: 1000;
    padding: 1rem;
    box-sizing: border-box;
}

.modal-content {
    background: #fff;
    padding: 1.5rem;
    border-radius: 8px;
    max-width: 900px;
    max-height: 90vh;
    width: 100%;
    position: relative;
    display: flex;
    flex-direction: column;
    animation: fadeIn 0.3s ease;
}

@keyframes fadeIn {
    from { opacity: 0; transform: scale(0.95); }
    to { opacity: 1; transform: scale(1); }
}

.close-button {
    position: absolute;
    top: -10px;
    right: -10px;
    background: #fff;
    color: #333;
    width: 30px;
    height: 30px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
    cursor: pointer;
    box-shadow: 0 4px 8px rgba(0,0,0,0.2);
    font-family: sans-serif;
    line-height: 1;
}

#modal-img {
    width: 100%;
    max-height: 65vh;
    object-fit: contain;
    border-radius: 4px;
}

#modal-caption {
    margin-top: 1rem;
    padding-top: 1rem;
    border-top: 1px solid #eee;
    font-size: 1.1rem;
    line-height: 1.6;
    text-align: left;
    color: #333;
    overflow-y: auto;
}