/* Mobile Optimization Improvements */
@media (max-width: 600px) {
    body {
        font-size: 1.08rem;
        padding: 0;
    }
    .tab, .send-btn, .slideshow-x-close {
        min-width: 48px;
        min-height: 48px;
        font-size: 1.1rem;
    }
    .portfolio-gallery {
        padding-left: 1vw !important;
        padding-right: 1vw !important;
        gap: 0.3vw !important;
    }
    .gallery {
        padding-left: 1vw !important;
        padding-right: 1vw !important;
        gap: 10px !important;
    }
    .portfolio-gallery img, .gallery img {
        max-width: 100vw;
        height: auto;
        min-width: 0;
        border-radius: 6px;
    }
    .modal .carousel-item img {
        max-height: 60vh;
        border-radius: 8px;
    }
    .modal-dialog {
        max-width: 98vw !important;
        width: 98vw !important;
        margin: 0 auto;
    }
    .main-title {
        font-size: 1.2rem !important;
        white-space: normal;
    }
    .hero-container {
        display: flex;
        flex-direction: column;
        align-items: stretch;
    }
    .hero-text-box {
        position: static !important;
        left: auto !important;
        right: auto !important;
        top: auto !important;
        bottom: auto !important;
        transform: none !important;
        max-width: 100% !important;
        font-size: 1rem;
        padding: 0.5rem 0.5rem;
        background: transparent;
        color: #111 !important;
        min-height: 9.5rem;
        box-sizing: border-box;
        margin: 0.5rem 10px 0;
    }

    /* Force all caption text to black on phones (overrides inline span colors) */
    .hero-text-box,
    .hero-text-box * {
        color: #111 !important;
    }
    .hero-text-box .highlight-arthur {
        color: #B31B1B !important;
    }

    .hero-text-box h2 {
        font-family: 'Montserrat', Arial, sans-serif;
        font-size: 1.25rem;
    }
    .hero-text-box p {
        font-family: 'Montserrat', Arial, sans-serif;
        font-size: 1rem;
        margin: 0;
    }

    /* Ensure per-slide positioning classes never overlap the image on phones */
    .hero-text-box.top-right,
    .hero-text-box.bottom-left,
    .hero-text-box.bottom-right,
    .hero-text-box.translate-right {
        position: static !important;
        left: auto !important;
        right: auto !important;
        top: auto !important;
        bottom: auto !important;
        transform: none !important;
    }
    .site-footer {
        padding: 0.5rem 1vw;
        font-size: 0.95rem;
    }

    /* Responsive header: stack vertically, prevent overlap */
    header {
        flex-direction: column !important;
        align-items: stretch !important;
        gap: 0.5rem !important;
        padding: 0.5rem 1vw !important;
    }
    .header-table, .header-row {
        display: block !important;
        width: 100% !important;
    }
    .main-title {
        text-align: center !important;
        margin: 0.2rem 0 0.2rem 0 !important;
        width: 100% !important;
    }
    .social-icons {
        justify-content: center !important;
        margin: 0.2rem 0 0.2rem 0 !important;
        width: 100% !important;
    }
    nav {
        flex-direction: row !important;
        flex-wrap: wrap !important;
        justify-content: center !important;
        width: 100% !important;
        gap: 0.15rem 0.3rem !important;
        padding-left: 0 !important;
        padding-right: 0 !important;
    }
    .tab {
        min-width: 60px !important;
        font-size: 1rem !important;
        padding: 0.4rem 0.5rem !important;
    }
}
.portfolio-column .gallery img.half-width {
    width: 100%;
    max-width: 100%;
    grid-column: span 1;
}
.portfolio-column .gallery img.small-thumb {
    width: 48%;
    min-width: 120px;
    max-width: 180px;
    height: auto;
    display: inline-block;
    margin-right: 2%;
}
/* Hide carousel arrows in modals */

/* Remove underline from nav bar items */
.tab {
    text-decoration: none !important;
}
.tab:visited {
    text-decoration: none !important;
}
.tab:hover {
    text-decoration: none !important;
}
.tab:active {
    text-decoration: none !important;
}
/* Consistent main page title style */
.main-title {
    font-family: 'Questrial', sans-serif;
    font-weight: 400 !important;
    font-size: 1.6rem !important;
     text-decoration: none;
    font-family: 'Questrial', sans-serif;
    font-weight: 400 !important;
    font-size: 1.6rem !important;
    text-decoration: none;
    text-align: left;
    margin: 0;
    white-space: nowrap;
    line-height: 1.1;
    letter-spacing: 0.02em;
}
.main-title .main-title-name {
    color: #000 !important;
}
.main-title .main-title-desc {
    color: #b3b3b3 !important;
}
#wildlifeCarousel .carousel-control-prev,
#wildlifeCarousel .carousel-control-next,
#peopleCarousel .carousel-control-prev,
#peopleCarousel .carousel-control-next {
    display: none !important;
}
/* Translate hero text box right for PicHome2 and PicHome3 */
.hero-text-box.translate-right {
    transform: translateX(30%);
}
/* Home hero circles */
.home-hero-circles {
    position: absolute;
    top: 18px;
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    gap: 10px;
    z-index: 2;
}
.home-hero-circle {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    background-color: #fff;
    display: inline-block;
    transition: background-color 0.5s cubic-bezier(.77,.2,.32,1.01);
}
:root { --page-pad: 24px; }

/* Base */
body {
    font-family: 'Montserrat', Arial, sans-serif;
    margin: 0;
    background: #f8f9fb;
    color: #222;
}

/* Freestyle Carousel: Black & White except on hover */
.freestyle-carousel .carousel-img {
    filter: grayscale(1);
    transition: filter 0.9s, transform 0.2s;
}
.freestyle-carousel .carousel-img:hover {
    filter: grayscale(0);
}

/* On mobile/touch layouts, make fully-visible carousel images turn colorful */
@media (max-width: 900px) {
    .freestyle-carousel .carousel-img.fully-visible {
        filter: grayscale(0);
    }
}
h1.main-title {
    flex: 1 1 auto;
    text-align: left;
    margin-right: 2rem;
}
header {
    background: transparent;
    padding: 1rem 2rem;
}
h1 { margin: 0; }

/* Header responsiveness: prevent title/nav overlap on narrow widths (Safari) */
@media (max-width: 1300px) {
    header {
        padding: 0.5rem 1vw !important;
    }
    header .header-table,
    header .header-table tbody,
    header .header-table tr,
    header .header-table td {
        display: block !important;
        width: 100% !important;
    }
    header .main-title {
        text-align: center !important;
        white-space: normal !important;
    }
    header nav {
        display: flex !important;
        flex-wrap: wrap !important;
        justify-content: center !important;
        white-space: normal !important;
        overflow-x: visible !important;
        gap: 0.35rem !important;
    }
    header .social-icons {
        justify-content: center !important;
        margin: 0.2rem 0 !important;
        width: 100% !important;
    }
}
nav {
    display: flex;
    gap: 0.75rem;
    width: 100%;
    justify-content: flex-start;
    align-items: center;
    overflow-x: auto;
    white-space: nowrap;
    scrollbar-width: thin;
    padding-bottom: 2px;
}
.tab { background: transparent; color: #999999; border: none; padding: 0.5rem 1rem; border-radius: 0; cursor: pointer; font-size: 1.235rem; }
.tab.active { background: transparent; color: #000; }
.tab:hover { background: transparent; color: #0c0c0c; }
.tab.active:hover { background: transparent; }
main { padding: 0 var(--page-pad) var(--page-pad); }
.tab-content { display: none; animation: fadeIn 0.3s; }
.tab-content.active { display: block; }

@media (max-width: 600px) {
    nav {
        gap: 0.3rem;
        padding-left: 2vw;
        padding-right: 2vw;
    }
    .tab {
        padding: 0.5rem 0.6rem;
        font-size: 1rem;
        min-width: 70px;
    }
}
@keyframes fadeIn { from {opacity: 0;} to {opacity: 1;} }

/* Social icons container */
.social-icons {
    margin: 0 auto;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.75rem;
}
.social-icons a { color: #999999; margin-left: 0; transition: color 0.2s; }
.social-icons a svg { width: 28px; height: 28px; }
.social-icons a.instagram-photo:hover { color: #f4c542; }
.social-icons a.instagram-life:hover { color: #f4c542; }
.social-icons a.email:hover { color: #87ceeb; }

/* Contact section: force Instagram/Email link color */
#contactInfoBox a {
    color: #63AAF1;
    text-decoration: none;
}
#contactInfoBox a:hover {
    color: #63AAF1;
    text-decoration: none;
}

/* Contact photo captions: center text without moving the overlay box */
.contact-photo-caption {
    text-align: center !important;
}

/* Home slideshow: slide 6 title color (desktop only) */
@media (min-width: 901px) {
    .hero-text-box .slide6-title {
        color: #000;
    }
}

/* Hero */
.hero-container { position: relative; width: calc(100% + 2 * var(--page-pad)); margin-left: calc(-1 * var(--page-pad)); margin-right: calc(-1 * var(--page-pad)); overflow: hidden; border-radius: 0; }
.hero-image.hero-full { width: 100%; height: auto; display: block; filter: saturate(1.05); }
.hero-text-box { position: absolute; left: 56px; top: 62%; transform: translateY(-50%); background: transparent; color: #fff; padding: 0.9rem 1.1rem; border-radius: 8px; max-width: min(92%, 720px); text-align: center; font-family: 'Montserrat', sans-serif; }
.hero-text-box.slide1-higher { top: 58%; }
/* Top right position for hero text box */
.hero-text-box.top-right {
    left: auto;
    right: 32px;
    top: 132px;
    transform: translateX(-50%);
    text-align: center;
    background: none;
}
.hero-text-box.center-left {
    left: 56px;
    right: auto;
    top: 50%;
    transform: translateY(-50%);
    text-align: center;
    background: none;
}
.hero-text-box.top-left {
    left: 56px;
    right: auto;
    top: 132px;
    transform: translateY(0);
    text-align: center;
    background: none;
}
.hero-text-box.top-right.slide-right-tight {
    right: 12px;
    transform: translateX(0);
}
.hero-text-box.top-right.slide-right-tight.slide-right-left {
    right: 24px;
}

.hero-text-box.bottom-left {
    left: 56px;
    right: auto;
    top: 62%;
    bottom: auto;
    transform: translateY(-50%);
    text-align: center;
    background: transparent;
    color: #fff;
    padding: 0.9rem 1.1rem;
    border-radius: 8px;
    max-width: min(92%, 720px);
    font-family: 'Montserrat', sans-serif;
}

.hero-text-box.bottom-right {
    position: absolute;
    left: auto !important;
    right: 56px !important;
    top: 62% !important;
    bottom: auto;
    transform: translateY(-50%) !important;
    text-align: center;
    background: transparent;
    color: #fff;
    padding: 0.9rem 1.1rem;
    border-radius: 8px;
    max-width: min(92%, 720px);
    font-family: 'Montserrat', sans-serif;
}

.hero-text-box.top-right.black-text {
    color: #000;
}
.hero-text-box h2 { margin: 0 0 0.25rem; font-size: clamp(1.1rem, 1.8vw, 1.6rem); font-weight: 600; }
.hero-text-box p { margin: 0; font-size: clamp(0.95rem, 1.5vw, 1.1rem); opacity: 0.95; }
.hero-date { opacity: 0.85; font-style: normal; }
.highlight-arthur { color: #B31B1B; }

/* Home tiles */
.home-tiles { display: flex; flex-wrap: wrap; gap: 2rem; justify-content: center; margin-top: 2rem; }
.home-tile-container { display: flex; flex-direction: column; align-items: center; text-decoration: none; color: inherit; }
.tile-caption { margin-top: 0.6rem; font-size: 1.1rem; font-weight: 500; color: #444; transition: color 0.2s; }
.home-tile-container:hover .tile-caption { color: #000; }
.home-tile { width: 432px; max-width: 90vw; height: 288px; object-fit: cover; border-radius: 0; box-shadow: 0 6px 18px rgba(0,0,0,0.15); filter: grayscale(100%); transition: filter 0.25s, transform 0.2s, box-shadow 0.2s; }
.home-tile:hover { filter: grayscale(0%); transform: scale(1.035); box-shadow: 0 10px 24px rgba(0,0,0,0.2); }

/* Portfolio grid */
.portfolio-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; align-items: start; }
.portfolio-column h3 { margin: 0.25rem 0 0.5rem; text-align: center; }
.portfolio-column .gallery { display: grid; grid-template-columns: repeat(2, 1fr); gap: 14px; }
.portfolio-column .gallery img { width: 100%; height: auto; object-fit: contain; border-radius: 0; filter: grayscale(18%); transition: filter 0.2s, transform 0.2s, border 0.2s; cursor: pointer; border: 3px solid transparent; }
.portfolio-column .gallery img:hover { filter: grayscale(0); transform: translateY(-2px); border: 3px solid #f4c542; }
.portfolio-column .gallery img.full-width { grid-column: 1 / -1; }

/* Section headings + description lines (direct children only) */
#wildlife > h2, #wildlife > p,
#candid > h2,  #candid > p,
#contact > h2, #contact > p {
    text-align: center;
}
#wildlife > h2, #candid > h2, #contact > h2 {
    margin-top: 1rem;
}
#wildlife > p, #candid > p, #contact > p {
    margin-top: 0.25rem;
    opacity: 0.9;
    font-family: 'Montserrat', Arial, sans-serif;
    font-size: 1rem;
    color: #222;
}

/* Center align Portfolio title and description (direct children only) */
#portfolio > h2, #portfolio > p { text-align: center; }
#portfolio > p {
    margin-top: 0.25rem;
    opacity: 0.9;
    font-family: 'Montserrat', Arial, sans-serif;
    font-size: 1rem;
    color: #222;
}

/* Add top gap under header for Portfolio section */
#portfolio { padding-top: 1rem; }

/* Generic gallery fallback */
.gallery { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: var(--page-pad); margin-top: 1rem; }
.gallery img { width: 100%; height: 180px; object-fit: cover; border-radius: 0; box-shadow: 0 2px 8px rgba(0,0,0,0.08); }

/* People/Wildlife: remove extra top gap above images (match Portfolio spacing) */
#candid .gallery,
#wildlife .gallery {
    margin-top: 0;
}

/* Smoother Bootstrap carousel slide transitions */
.carousel .carousel-item {
    transition: transform 0.85s cubic-bezier(0.4, 0, 0.2, 1);
}

/* Carousel modal images */
.modal .carousel-item img { max-height: 90vh; object-fit: contain; background: transparent; border-radius: 0; }

/* Position carousel arrows at bottom */

/* Position arrows flush to image border */
.modal .carousel-control-prev,
.modal .carousel-control-next {
    top: 50%;
    transform: translateY(-50%);
    bottom: auto;
    width: 48px;
    height: 48px;
    background: rgba(255,255,255,0.01);
    border-radius: 50%;
    box-shadow: none;
    z-index: 2;
}
.modal .carousel-control-prev { left: 0; }
.modal .carousel-control-next { right: 0; }

/* Move close button to bottom right, flush to image border */

/* Move close button to top right corner of modal */

.modal .modal-header {
    position: absolute;
    top: 0;
    right: 0;
    left: auto;
    bottom: auto;
    z-index: 3;
    padding: 0.5rem 0.5rem 0 0;
    background: none;
    border: none;
}
.modal .slideshow-x-close {
    color: #fff;
    background: none;
    border: none;
    font-size: 2rem;
    line-height: 1;
    width: 40px;
    height: 40px;
    padding: 0;
    margin: 0;
    cursor: pointer;
    position: relative;
    right: 0;
    top: 0;
    z-index: 10;
    opacity: 0.85;
    transition: opacity 0.2s;
}
.modal .slideshow-x-close:hover {
    opacity: 1;
}

/* Reduce slideshow modal size by half */
#carouselSlideshowModal .modal-dialog {
    max-width: 700px;
    width: 90vw;
}

/* Responsive tweaks */
@media (max-width: 900px) {
    .portfolio-grid { grid-template-columns: 1fr; }
    /* First slide: 'Arthur' color mobile override */
    .hero-text-box h2 .highlight-arthur {
        color: #B31B1B !important;
    }
    /* Contact section image overlay responsiveness */
    #contact > div[style*="position:relative"] {
        max-width: 100vw !important;
        overflow: visible !important;
        display: flex !important;
        flex-direction: column !important;
        align-items: center !important;
    }
    #contact img[alt="Contact"] {
        max-height: none !important;
        height: auto !important;
        object-fit: contain !important;
        width: 100% !important;
        border-radius: 0 !important;
        order: 2;
    }

    /* In mobile mode, place the Instagram/Email table above the photo */
    #contactInfoBox {
        order: 1;
    }
    #contact > div[style*="position:relative"] > div[style*="position:absolute"]:not(#contactInfoBox) {
        order: 3;
    }
    #contact div[style*="position:absolute"] {
        position: static !important;
        transform: none !important;
        padding: 0.5rem 0.5rem 0.5rem 0.5rem !important;
        background: transparent !important;
        color: inherit !important;
        border-radius: 8px !important;
        margin: 0.5rem auto 0.5rem auto !important;
        max-width: 98vw !important;
        min-width: 0 !important;
        text-align: center !important;
        box-sizing: border-box;
        width: 98vw !important;
    }
    #contact div[style*="position:absolute"] h2,
    #contact div[style*="position:absolute"] p {
        font-size: 1.05rem !important;
        line-height: 1.2 !important;
        margin: 0.25rem 0 !important;
        word-break: break-word !important;
        color: inherit !important;
        text-shadow: none !important;
    }
    #contact div[style*="position:absolute"] span {
        color: inherit !important;
    }
    #contact div[style*="position:absolute"] a {
        color: #63AAF1 !important;
        word-break: break-all;
        text-decoration: none !important;
    }

    /* Contact info table: left aligned and transparent on mobile */
    #contactInfoBox {
        background: transparent !important;
        text-align: left !important;
        justify-items: start !important;
    }
    #contactInfoBox > div {
        justify-items: start !important;
    }
    /* Fix hero-text-box and titles for mobile slideshow */
    .hero-text-box {
        position: static !important;
        left: 0 !important;
        right: 0 !important;
        top: auto !important;
        transform: none !important;
        max-width: 98vw !important;
        width: 98vw !important;
        margin: 0.5rem auto 0.5rem auto !important;
        padding: 0.5rem 0.5rem !important;
        background: transparent !important;
        color: #111 !important;
        border-radius: 8px !important;
        z-index: 2;
        text-align: center !important;
        box-sizing: border-box;
        min-height: 9.5rem;
    }

    /* Keep all per-slide positioning variants in document flow on phones/tablets */
    .hero-container .hero-text-box.top-right,
    .hero-container .hero-text-box.top-left,
    .hero-container .hero-text-box.center-left,
    .hero-container .hero-text-box.bottom-left,
    .hero-container .hero-text-box.bottom-right,
    .hero-container .hero-text-box.translate-right,
    .hero-container .hero-text-box.slide1-higher,
    .hero-container .hero-text-box.slide-right-tight,
    .hero-container .hero-text-box.slide-right-left {
        position: static !important;
        left: auto !important;
        right: auto !important;
        top: auto !important;
        bottom: auto !important;
        transform: none !important;
    }

    /* Force all caption text to black on phones (overrides inline span colors) */
    .hero-text-box,
    .hero-text-box * {
        color: #111 !important;
    }
    .hero-text-box h2, .hero-text-box p {
        font-size: 1.05rem !important;
        line-height: 1.2 !important;
        margin: 0.25rem 0 !important;
        word-break: break-word !important;
        color: #111 !important;
        text-shadow: none !important;
    }
    .hero-text-box .highlight-arthur {
        color: #B31B1B !important;
    }
    .hero-image.hero-full {
        max-height: none !important;
        height: auto !important;
        object-fit: contain !important;
    }
    .hero-container {
        overflow: visible !important;
    }
    #homeParallaxImg,
    #homeParallaxImg4 {
        transform: none !important;
    }
    .portfolio-column .gallery { grid-template-columns: 1fr 1fr; }
    .home-tile {
        height: auto !important;
        width: 100% !important;
        max-width: 96vw;
        object-fit: contain !important;
    }
}
@media (max-width: 600px) {
    header { flex-direction: column; align-items: flex-start; gap: 0.5rem; }
    nav {
        width: 100%;
        flex-wrap: wrap;
        justify-content: flex-end;
    }
    .portfolio-column .gallery { grid-template-columns: 1fr; }
    .home-tile {
        width: 96vw;
        height: auto !important;
        object-fit: contain !important;
    }
}

/* Footer */
.site-footer { background: #333; color: #fff; text-align: center; padding: 1rem var(--page-pad); border-top: 1px solid #444; display: flex; align-items: center; justify-content: center; }
.site-footer p { margin: 0; }
.site-footer a { color: inherit; text-decoration: none; }

/* Contact Form */
.contact-form-container { max-width: 600px; margin: 2rem auto; padding: 0 1rem; }
.contact-form { display: flex; flex-direction: column; gap: 1.5rem; }
.form-group { display: flex; flex-direction: column; gap: 0.5rem; }
.form-group label { font-weight: 500; color: #333; font-size: 1rem; }
.form-group input, .form-group textarea { padding: 0.75rem; border: 2px solid #ddd; border-radius: 4px; font-family: 'Montserrat', sans-serif; font-size: 1rem; transition: border-color 0.3s; }
.form-group input:focus, .form-group textarea:focus { outline: none; border-color: #f4c542; }

/* Contact section links: no underline */
#contact a,
#contact a:visited,
#contact a:hover,
#contact a:active {
    text-decoration: none;
}
.send-btn { background: #f4c542; color: #333; border: none; padding: 0.875rem 2rem; font-size: 1rem; font-weight: 600; border-radius: 4px; cursor: pointer; transition: background 0.3s, transform 0.2s; font-family: 'Montserrat', sans-serif; align-self: center; }
.send-btn:hover { background: #e0b338; transform: translateY(-2px); }
.send-btn:active { transform: translateY(0); }

/* Mixed Gallery Layout (for pages with landscape and portrait mix) */
.mixed-gallery { display: grid; grid-template-columns: 1fr 1fr; gap: 1rem; }
.mixed-gallery .full-width { grid-column: 1 / -1; text-align: center; }
.mixed-gallery .two-column { text-align: center; }
@media (max-width: 900px) { .mixed-gallery { grid-template-columns: 1fr; } .mixed-gallery .full-width { grid-column: 1; } }

/* Contact Page Styles */
.contact-form-container {
    max-width: 500px;
    margin: 2rem auto;
    background: #fff;
    border-radius: 12px;
    box-shadow: 0 2px 12px rgba(0,0,0,0.08);
    padding: 2rem;
}
.contact-form {
    display: flex;
    flex-direction: column;
    gap: 1.25rem;
}
.form-group {
    display: flex;
    flex-direction: column;
}
.form-group label {
    font-weight: 500;
    margin-bottom: 0.5rem;
}
.form-group input,
.form-group textarea {
    padding: 0.75rem;
    border: 1px solid #ccc;
    border-radius: 6px;
    font-size: 1rem;
    background: #f9f9f9;
}
.form-group input:focus,
.form-group textarea:focus {
    outline: none;
    border-color: #b31b1b;
}
.send-btn {
    background: #b31b1b;
    color: #fff;
    border: none;
    border-radius: 6px;
    padding: 0.75rem 1.5rem;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.2s;
}
.send-btn:hover {
    background: #8a1414;
}

@media (max-width: 600px) {
    .contact-form-container {
        padding: 1rem;
        max-width: 95vw;
    }
    .contact-form {
        gap: 1rem;
    }
    .form-group input,
    .form-group textarea {
        font-size: 0.95rem;
        padding: 0.6rem;
    }
    .send-btn {
        font-size: 0.95rem;
        padding: 0.6rem 1.2rem;
    }
}

/* Reduce story image gaps on iPhone-sized screens (People/Wildlife story pages) */
@media (max-width: 600px) {
    body[data-parent-tab="candid"] main section.tab-content.active > div[style*="display:flex"][style*="gap:1rem"],
    body[data-parent-tab="wildlife"] main section.tab-content.active > div[style*="display:flex"][style*="gap:1rem"],
    body[data-parent-tab="candid"] main section.tab-content.active div[style*="display:grid"][style*="gap:1rem"],
    body[data-parent-tab="wildlife"] main section.tab-content.active div[style*="display:grid"][style*="gap:1rem"] {
        gap: 0.5rem !important;
    }
}
