/* ============================================================
 * Bromo Paradiso Theme - Custom Styles
 * Mobile-first approach: base styles are mobile,
 * then sm/md/lg breakpoints scale up.
 * ============================================================ */

/* -------------------------------------------------------
 * NAVIGATION & STICKY HEADER
 *
 * On front page: nav starts transparent (inside hero),
 * becomes solid/sticky on scroll.
 * On inner pages: nav is always solid dark.
 * ------------------------------------------------------- */

/* Nav link colors — bright white matching original design.
 * WordPress menu items must inherit this explicitly
 * since wp_nav_menu() adds its own classes. */
#primary-menu {
    list-style: none;
    padding: 0;
    margin: 0;
}

#primary-menu li {
    display: list-item;
}

#primary-menu li a,
#primary-menu > li > a {
    color: rgba(255, 255, 255, 0.9);
    transition: color 0.2s;
    padding: 0.25rem 0.5rem;
    border-radius: 0.25rem;
    display: inline-block;
}

#primary-menu li a:hover,
#primary-menu li a:focus {
    color: #6b8e23; /* brand-500 */
}

#primary-menu li.current-menu-item > a,
#primary-menu li.current_page_item > a,
#primary-menu li.current-menu-ancestor > a {
    color: #6b8e23; /* brand-500 */
}

/* Hero-transparent state: nav overlaying hero background.
 * No background, text is white against hero image. */
.nav-hero-transparent {
    background: transparent !important;
    border-bottom-color: rgba(255, 255, 255, 0.1);
}

.nav-hero-transparent #primary-menu li a,
.nav-hero-transparent #primary-menu > li > a {
    color: rgba(255, 255, 255, 0.9);
}

.nav-hero-transparent #primary-menu li a:hover,
.nav-hero-transparent #primary-menu li a:focus {
    color: #6b8e23;
}

/* Sticky state: nav detaches and sticks to top with solid bg. */
.nav-sticky {
    position: fixed !important;
    top: 0 !important;
    left: 0;
    right: 0;
    z-index: 50 !important;
    background: #1f2937 !important; /* brand-dark */
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.15);
    animation: slideDown 0.3s ease-out;
}

.nav-sticky .container {
    /* Slightly tighter padding when sticky. */
    padding-top: 0.75rem;
    padding-bottom: 0.75rem;
}

@keyframes slideDown {
    from {
        transform: translateY(-100%);
        opacity: 0;
    }
    to {
        transform: translateY(0);
        opacity: 1;
    }
}

/* -------------------------------------------------------
 * CUSTOM LOGO — full image display
 *
 * When a logo image is uploaded via Customizer, it replaces
 * the fallback icon. The logo should display as a full
 * image (not constrained to a small square). The <a> wrapper
 * from the_custom_logo() already links to the homepage.
 * ------------------------------------------------------- */

/* The <a> wrapper that WordPress puts around the logo. */
.custom-logo-link {
    display: flex;
    align-items: center;
    line-height: 0; /* prevent extra bottom space */
}

/* The <img> element itself — scales responsively, mobile-first. */
img.custom-logo {
    height: auto;
    max-height: 2.5rem;   /* 40px mobile */
    width: auto;
    object-fit: contain;
    display: block;
}

@media (min-width: 640px) {
    img.custom-logo {
        max-height: 2.75rem; /* 44px sm */
    }
}

@media (min-width: 768px) {
    img.custom-logo {
        max-height: 3rem;   /* 48px md */
    }
}

@media (min-width: 1024px) {
    img.custom-logo {
        max-height: 3.5rem; /* 56px lg */
    }
}

/* When sticky, tighten the logo slightly. */
.nav-sticky img.custom-logo {
    max-height: 2.5rem;
}

/* Also handle the fallback icon sizing to match. */
.site-logo-icon {
    width: 3rem;    /* 48px */
    height: 3rem;
    border-radius: 9999px; /* full */
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.2);
    display: flex;
    align-items: center;
    justify-content: center;
    backdrop-filter: blur(8px);
    flex-shrink: 0;
}

.site-logo-icon-i {
    color: #6b8e23; /* brand-500 */
    font-size: 1.5rem; /* text-2xl */
}

.nav-sticky .site-logo-icon {
    width: 2.5rem;
    height: 2.5rem;
}

.nav-sticky .site-logo-icon-i {
    font-size: 1.25rem;
}

/* Polaroid Effect */
.polaroid {
    background: white;
    padding: 0.5rem 0.5rem 2rem 0.5rem;
    box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);
    border: 1px solid #e5e7eb;
}

/* Custom scrollbar */
::-webkit-scrollbar { width: 8px; }
::-webkit-scrollbar-track { background: #f1f1f1; }
::-webkit-scrollbar-thumb { background: #cbd5e1; border-radius: 4px; }
::-webkit-scrollbar-thumb:hover { background: #94a3b8; }

/* Section Title Line */
.title-line {
    display: inline-block;
    width: 2rem;
    height: 2px;
    background-color: #6b8e23;
    vertical-align: middle;
}

/* Mobile menu animation */
#mobile-menu {
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.3s ease-out;
    background: #1f2937; /* brand-dark */
}

#mobile-menu.is-open {
    max-height: 100vh;
    overflow: visible;
}

/* Mobile menu link styles — bright white text. */
#mobile-menu a {
    display: block;
    padding: 0.75rem 1.5rem;
    color: rgba(255, 255, 255, 0.9);
    font-size: 0.875rem;
    font-weight: 500;
    transition: all 0.2s;
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}

#mobile-menu a:hover,
#mobile-menu a:focus {
    color: #6b8e23;
    background: rgba(255, 255, 255, 0.05);
}

#mobile-menu .current-menu-item > a {
    color: #6b8e23;
}

/* Desktop menu current item (fallback when wp_nav_menu is used)
 * This is redundant with the #primary-menu rules above but kept
 * as a safety net for any menu container. */
.current-menu-item > a,
.current_page_item > a {
    color: #6b8e23 !important;
}

/* Testimonial carousel */
.testimonial-slide {
    display: none;
}

.testimonial-slide.is-active {
    display: flex;
}

/* Line clamp utility */
.line-clamp-3 {
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

/* Gallery item hover */
.gallery-item img {
    transition: transform 0.5s ease;
}

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

/* WordPress alignment classes */
.alignleft {
    float: left;
    margin-right: 1.5em;
    margin-bottom: 1em;
}

.alignright {
    float: right;
    margin-left: 1.5em;
    margin-bottom: 1em;
}

.aligncenter {
    clear: both;
    display: block;
    margin-left: auto;
    margin-right: auto;
}

.alignwide {
    max-width: calc(100% + 4rem);
    margin-left: -2rem;
    margin-right: -2rem;
}

@media (min-width: 768px) {
    .alignwide {
        max-width: calc(100% + 8rem);
        margin-left: -4rem;
        margin-right: -4rem;
    }
}

.alignfull {
    max-width: 100vw;
    margin-left: calc(-50vw + 50%);
    margin-right: calc(-50vw + 50%);
}

/* WordPress caption */
.wp-caption {
    max-width: 100%;
}

.wp-caption-text {
    font-size: 0.875rem;
    color: #6b7280;
    text-align: center;
    margin-top: 0.5rem;
}

/* Screen reader text */
.screen-reader-text {
    border: 0;
    clip: rect(1px, 1px, 1px, 1px);
    clip-path: inset(50%);
    height: 1px;
    margin: -1px;
    overflow: hidden;
    padding: 0;
    position: absolute;
    width: 1px;
    word-wrap: normal !important;
}

.screen-reader-text:focus {
    background-color: #f1f1f1;
    border-radius: 3px;
    box-shadow: 0 0 2px 2px rgba(0, 0, 0, 0.6);
    clip: auto !important;
    clip-path: none;
    color: #21759b;
    display: block;
    font-size: 0.875rem;
    font-weight: 700;
    height: auto;
    left: 5px;
    line-height: normal;
    padding: 15px 23px 14px;
    text-decoration: none;
    top: 5px;
    width: auto;
    z-index: 100000;
}

/* Post content styles */
.entry-content h1,
.entry-content h2,
.entry-content h3,
.entry-content h4,
.entry-content h5,
.entry-content h6 {
    color: #1f2937;
    font-family: 'Playfair Display', serif;
    font-weight: 700;
    margin-top: 2em;
    margin-bottom: 0.75em;
}

.entry-content h2 {
    font-size: 1.875rem;
    line-height: 1.3;
}

.entry-content h3 {
    font-size: 1.5rem;
    line-height: 1.3;
}

.entry-content p {
    margin-bottom: 1.5em;
    line-height: 1.75;
}

.entry-content img {
    max-width: 100%;
    height: auto;
    border-radius: 0.5rem;
}

.entry-content a {
    color: #6b8e23;
    text-decoration: underline;
}

.entry-content a:hover {
    color: #5a7b1b;
}

.entry-content ul,
.entry-content ol {
    margin-bottom: 1.5em;
    padding-left: 2em;
}

.entry-content li {
    margin-bottom: 0.5em;
}

.entry-content blockquote {
    border-left: 4px solid #6b8e23;
    padding-left: 1.5rem;
    margin: 2em 0;
    font-style: italic;
    color: #4b5563;
}

/* Search form */
.search-form {
    display: flex;
    gap: 0.5rem;
}

.search-form .search-field {
    flex: 1;
    padding: 0.5rem 1rem;
    border: 1px solid #d1d5db;
    border-radius: 0.5rem;
    font-size: 0.875rem;
}

.search-form .search-submit {
    padding: 0.5rem 1.25rem;
    background-color: #6b8e23;
    color: white;
    border: none;
    border-radius: 0.5rem;
    font-size: 0.875rem;
    font-weight: 600;
    cursor: pointer;
    transition: background-color 0.2s;
}

.search-form .search-submit:hover {
    background-color: #5a7b1b;
}

/* Pagination */
.nav-links {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    justify-content: center;
    margin-top: 3rem;
}

.nav-links .page-numbers {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 2.5rem;
    height: 2.5rem;
    padding: 0 0.75rem;
    border: 1px solid #d1d5db;
    border-radius: 0.5rem;
    font-size: 0.875rem;
    color: #374151;
    transition: all 0.2s;
}

.nav-links .page-numbers:hover {
    background-color: #6b8e23;
    color: white;
    border-color: #6b8e23;
}

.nav-links .page-numbers.current {
    background-color: #6b8e23;
    color: white;
    border-color: #6b8e23;
}

/* 404 page */
.error-404 .page-content {
    text-align: center;
    padding: 4rem 1rem;
}