/* ================================================================
   SITE THEME — shared public-website design system
   Loaded on every public page after style.css / public-phase2.css.
   Centralizes navbar-solid behavior, logo link fix, page headers,
   section spacing, card/form/button system and responsive rules so
   no page needs its own header/footer/logo hacks.
   ================================================================ */

/* ===== LOGO LINK FIX =====
   The brand logo is rendered as <a class="logo">Arunalaya<span>.</span></a>
   on every public page. These rules guarantee:
   - correct brand color (white on transparent hero, charcoal on solid/scrolled)
   - NO browser-default blue link color
   - NO underline (including :hover and :visited)
   - the "." accent span is always gold
   Specificity is kept high enough to win over generic <a> defaults. */
a.logo,
.logo > a {
    color: #fff;
    text-decoration: none !important;
    font-family: 'Playfair Display', serif;
    font-size: 1.8rem;
    font-weight: 700;
    transition: var(--transition);
    display: inline-flex;
    align-items: center;
    gap: 6px;
    white-space: nowrap;
}
/* Solid / scrolled navbar = dark text (inner pages + homepage after scroll) */
.navbar-solid a.logo,
.navbar-solid .logo > a,
.navbar.scrolled a.logo,
.navbar.scrolled .logo > a {
    color: var(--charcoal);
}
a.logo:hover,
.logo > a:hover {
    color: var(--gold);
    text-decoration: none !important;
}
a.logo:visited,
.logo > a:visited {
    color: inherit;
}
a.logo span,
.logo > a span,
a.logo:visited span,
.logo > a:visited span {
    color: var(--gold);
}
/* Managed logo image: no broken-image border or link artifact */
.logo img {
    border: none;
    outline: none;
    text-decoration: none;
    display: inline-block;
    max-height: 40px;
    width: auto;
    object-fit: contain;
    vertical-align: middle;
    flex-shrink: 0;
}
.logo img[src=""],
.logo img:not([src]) {
    display: none !important;
}

/* ===== NAVBAR SOLID ON INNER PAGES (Issue 3) =====
   The homepage keeps the transparent->scrolled hero effect. Inner
   pages have no hero behind the navbar, so they need a solid header
   from the start. Add class "navbar-solid" to <nav> on non-home pages. */
.navbar-solid {
    background: rgba(255, 252, 247, 0.96);
    backdrop-filter: blur(20px);
    box-shadow: 0 2px 24px rgba(0, 0, 0, 0.06);
    padding: 12px 0;
}
.navbar-solid .logo,
.navbar-solid .logo a,
.navbar-solid a.logo {
    color: var(--charcoal);
}
.navbar-solid .nav-links a {
    color: var(--charcoal);
}
.navbar-solid .hamburger {
    color: var(--charcoal);
}
/* When solid + scrolled, keep the same solid look (style.css adds .scrolled) */
.navbar-solid.scrolled {
    background: rgba(255, 252, 247, 0.98);
    box-shadow: 0 4px 30px rgba(0, 0, 0, 0.08);
}
/* Active nav state */
.nav-links a.active {
    color: var(--gold) !important;
    font-weight: 600;
}
.nav-links a.active::after {
    width: 100%;
}
.nav-links .nav-cta,
.nav-links .nav-cta:link,
.nav-links .nav-cta:visited {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 150px;
    padding: 12px 30px;
    border-radius: 999px;
    white-space: nowrap;
    text-align: center;
    line-height: 1.2;
}

/* ===== PAGE HEADER (consistent top spacing for inner pages, Issue 3) =====
   Replaces ad-hoc padding-top:140px inline styles. */
.page-header {
    padding: 130px 0 40px;
    background: linear-gradient(180deg, var(--cream) 0%, var(--warm-white) 100%);
    text-align: center;
}
.page-header .section-title {
    margin-bottom: 8px;
}
.page-header .section-sub {
    max-width: 640px;
    margin: 0 auto;
}

/* ===== SECTION SPACING SYSTEM ===== */
.section {
    padding: 70px 0;
}
.section-sm {
    padding: 48px 0;
}
.section-tight {
    padding: 40px 0;
}

/* ===== CARD SYSTEM (Issue 14) ===== */
.card {
    background: #fff;
    border-radius: var(--radius-sm);
    box-shadow: 0 6px 24px rgba(0, 0, 0, 0.06);
    border: 1px solid rgba(0, 0, 0, 0.04);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    overflow: hidden;
}
.card:hover {
    transform: translateY(-6px);
    box-shadow: 0 16px 40px rgba(0, 0, 0, 0.1);
}
.card-body {
    padding: 28px;
}
.card-icon {
    width: 64px;
    height: 64px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.6rem;
    color: var(--gold);
    background: rgba(201, 168, 76, 0.12);
    margin-bottom: 18px;
}
.card h3 {
    font-family: 'Playfair Display', serif;
    font-size: 1.3rem;
    margin-bottom: 10px;
}
.card p {
    color: #555;
    line-height: 1.7;
    font-size: 0.96rem;
}

/* ===== FORM SYSTEM (Issue 25) ===== */
.form-field {
    margin-bottom: 18px;
}
.form-field label {
    display: block;
    font-weight: 600;
    font-size: 0.88rem;
    color: var(--charcoal);
    margin-bottom: 7px;
    letter-spacing: 0.2px;
}
.form-field input,
.form-field textarea,
.form-field select {
    width: 100%;
    padding: 14px 18px;
    border: 1.5px solid #e4e0d8;
    border-radius: 14px;
    font-family: 'Inter', sans-serif;
    font-size: 0.96rem;
    transition: var(--transition);
    background: #faf8f4;
    color: var(--charcoal);
}
.form-field input:focus,
.form-field textarea:focus,
.form-field select:focus {
    border-color: var(--gold);
    background: #fff;
    box-shadow: 0 0 0 3px rgba(201, 168, 76, 0.15);
    outline: none;
}
.form-field input.error,
.form-field textarea.error {
    border-color: #e53935;
    background: #fff5f5;
}
.form-error {
    color: #e53935;
    font-size: 0.82rem;
    margin-top: 5px;
    display: none;
}
.form-error.show {
    display: block;
}

/* ===== BUTTON SIZE VARIANTS (Issue 24) ===== */
.btn-sm {
    padding: 10px 22px;
    font-size: 0.88rem;
}
.btn-lg {
    padding: 18px 48px;
    font-size: 1.05rem;
}
.btn-block {
    width: 100%;
    justify-content: center;
}
.btn-success {
    background: linear-gradient(135deg, #2ecc71, #27ae60);
    color: #fff;
    box-shadow: 0 8px 30px rgba(46, 204, 113, 0.3);
}
.btn-success:hover {
    transform: translateY(-3px);
    box-shadow: 0 12px 40px rgba(46, 204, 113, 0.4);
}
.btn-danger {
    background: linear-gradient(135deg, #e74c3c, #c0392b);
    color: #fff;
    box-shadow: 0 8px 30px rgba(231, 76, 60, 0.3);
}
.btn-danger:hover {
    transform: translateY(-3px);
    box-shadow: 0 12px 40px rgba(231, 76, 60, 0.4);
}
.btn:disabled,
.btn.disabled {
    opacity: 0.55;
    cursor: not-allowed;
    transform: none !important;
    box-shadow: none !important;
}

/* ===== STATE HELPERS (Issue 27) ===== */
.state-empty,
.state-error {
    text-align: center;
    padding: 50px 20px;
    color: #999;
}
.state-empty i,
.state-error i {
    font-size: 2.4rem;
    color: #d4cdbf;
    margin-bottom: 14px;
    display: block;
}
.state-loading {
    text-align: center;
    padding: 40px 20px;
    color: #999;
}
.state-loading .spinner {
    width: 36px;
    height: 36px;
    border: 3px solid #eee;
    border-top-color: var(--gold);
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
    margin: 0 auto 14px;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* ===== GALLERY IMPROVEMENTS (Issue 4,18,28) ===== */
.gallery-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 24px;
}
/* When managed grid is empty/hidden, collapse it so no blank space shows */
.gallery-grid:empty {
    display: none;
}
/* Clean empty-state for gallery when no items exist at all */
.gallery-empty-state {
    text-align: center;
    padding: 60px 20px;
    color: var(--muted, #888);
}
.gallery-empty-state i {
    font-size: 3rem;
    color: var(--gold, #c9a84c);
    opacity: 0.4;
    margin-bottom: 12px;
}
.gallery-empty-state p {
    font-size: 1.1rem;
    margin: 0;
}
.gallery-item {
    position: relative;
    border-radius: 20px;
    overflow: hidden;
    box-shadow: var(--shadow);
    background: #f0ede7;
    aspect-ratio: 4 / 3;
}
.gallery-item img,
.gallery-item video {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
    background: #ddd;
    transition: transform 0.35s ease;
}
.gallery-item video {
    background: #111;
}
.gallery-item .caption {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    padding: 14px 16px;
    font-weight: 500;
    background: linear-gradient(transparent, rgba(0, 0, 0, 0.7));
    color: #fff;
    font-size: 0.9rem;
}
.gallery-item .media-error {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    height: 100%;
    color: #b0aaa0;
    gap: 8px;
    text-align: center;
    padding: 20px;
}
.gallery-item .media-error i {
    font-size: 2rem;
}

/* ===== FLOAT BUTTONS REFINEMENT (Issue 7) =====
   Consistent z-index across pages, safe spacing to avoid overlapping
   forms/buttons/gallery/booking controls/footer.  z-index 900 stays
   below modals (1000+) but above normal content. */
.float-buttons {
    position: fixed;
    bottom: 24px;
    right: 20px;
    display: flex;
    flex-direction: column;
    gap: 10px;
    z-index: 900;
}
.float-btn {
    width: 52px;
    height: 52px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.4rem;
    color: #fff;
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.18);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    text-decoration: none;
    border: none;
    cursor: pointer;
    position: relative;
}
.float-btn:hover {
    transform: scale(1.08);
    box-shadow: 0 10px 28px rgba(0, 0, 0, 0.25);
    text-decoration: none;
}
/* Pulse ring for WhatsApp to draw attention subtly */
.float-btn.whatsapp::after {
    content: '';
    position: absolute;
    inset: 0;
    border-radius: 50%;
    border: 2px solid #25d366;
    animation: floatPulse 2.4s ease-out infinite;
}
@keyframes floatPulse {
    0% { transform: scale(1); opacity: 0.7; }
    100% { transform: scale(1.5); opacity: 0; }
}
/* Hide pulse animation for users who prefer reduced motion */
@media (prefers-reduced-motion: reduce) {
    .float-btn.whatsapp::after { animation: none; }
}

/* ===== MAP CONTAINER (Issue 6) ===== */
.map-container {
    position: relative;
    border-radius: var(--radius);
    overflow: hidden;
    box-shadow: var(--shadow);
    min-height: 380px;
    background: #e8eef0;
}
.map-container iframe {
    width: 100%;
    height: 100%;
    min-height: 380px;
    border: 0;
    display: block;
}
/* Graceful map placeholder when no embed configured */
.map-placeholder {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    min-height: 380px;
    text-align: center;
    padding: 40px 24px;
    background: linear-gradient(135deg, #eef3f0, #e3ebe6);
    color: #5a6b62;
}
.map-placeholder i {
    font-size: 3rem;
    color: var(--gold);
    margin-bottom: 16px;
}
.map-placeholder h3 {
    font-family: 'Playfair Display', serif;
    margin-bottom: 8px;
    color: var(--charcoal);
}
.map-placeholder p {
    margin-bottom: 18px;
    max-width: 360px;
}

/* ===== TYPOGRAPHY HELPERS (Issue 23) ===== */
.text-center { text-align: center; }
.text-muted { color: #888; }
.eyebrow {
    text-transform: uppercase;
    letter-spacing: 3px;
    font-size: 0.8rem;
    font-weight: 600;
    color: var(--gold);
    display: inline-block;
    margin-bottom: 10px;
}

/* ===== 404 PAGE (Issue 30) ===== */
.error-page {
    min-height: 70vh;
    display: flex;
    align-items: center;
    justify-content: center;
    text-align: center;
    padding: 140px 20px 60px;
}
.error-page .error-code {
    font-family: 'Playfair Display', serif;
    font-size: clamp(5rem, 18vw, 9rem);
    line-height: 1;
    color: var(--gold);
    margin-bottom: 10px;
}
.error-page h1 {
    font-family: 'Playfair Display', serif;
    font-size: 2rem;
    margin-bottom: 14px;
}
.error-page p {
    color: #777;
    max-width: 480px;
    margin: 0 auto 28px;
}
.error-page .btn-group {
    display: flex;
    gap: 14px;
    justify-content: center;
    flex-wrap: wrap;
}

/* ===== PAGE & SECTION TRANSITIONS ===== */
html {
    scroll-behavior: smooth;
}
body {
    animation: fadeInPage 0.6s ease-out;
}
@keyframes fadeInPage {
    from { opacity: 0; transform: translateY(8px); }
    to { opacity: 1; transform: translateY(0); }
}

/* ===== REVEAL ON SCROLL ANIMATION ===== */
.service-card,
.facility-item,
.pricing-card,
.testimonial-card,
.faq-item,
.gallery-item,
.about-grid > div,
.card {
    animation: revealUp 0.8s cubic-bezier(0.34, 1.56, 0.64, 1) backwards;
}
@keyframes revealUp {
    from {
        opacity: 0;
        transform: translateY(40px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}
.service-card { animation-delay: 0.1s; }
.service-card:nth-child(2) { animation-delay: 0.2s; }
.service-card:nth-child(3) { animation-delay: 0.3s; }
.service-card:nth-child(n+4) { animation-delay: 0.4s; }
.pricing-card:nth-child(1) { animation-delay: 0.1s; }
.pricing-card:nth-child(2) { animation-delay: 0.2s; }
.pricing-card:nth-child(3) { animation-delay: 0.3s; }
.testimonial-card:nth-child(1) { animation-delay: 0.1s; }
.testimonial-card:nth-child(2) { animation-delay: 0.2s; }
.testimonial-card:nth-child(3) { animation-delay: 0.3s; }
.gallery-item:nth-child(1) { animation-delay: 0.05s; }
.gallery-item:nth-child(2) { animation-delay: 0.1s; }
.gallery-item:nth-child(3) { animation-delay: 0.15s; }
.gallery-item:nth-child(n+4) { animation-delay: 0.2s; }

/* ===== INTRO SECTIONS (Enhanced Rhythm) ===== */
.section-intro {
    text-align: center;
    max-width: 720px;
    margin: 0 auto 60px;
    animation: revealUp 0.8s ease-out;
}
.section-intro .eyebrow {
    display: inline-block;
    margin-bottom: 14px;
}
.section-intro h2 {
    font-family: 'Playfair Display', serif;
    font-size: 2.4rem;
    font-weight: 700;
    margin-bottom: 16px;
    line-height: 1.2;
    color: var(--charcoal);
}
.section-intro h2 span {
    color: var(--gold);
}
.section-intro p {
    font-size: 1.05rem;
    color: #666;
    line-height: 1.8;
}

/* ===== ENHANCED CARD HOVER EFFECTS ===== */
.service-card {
    position: relative;
    overflow: hidden;
    border-radius: var(--radius-sm);
    padding: 36px 28px;
    background: #fff;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.04);
    border: 1px solid rgba(0, 0, 0, 0.03);
    transition: all 0.4s cubic-bezier(0.25, 0.46, 0.45, 0.94);
}
.service-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 4px;
    background: linear-gradient(90deg, var(--gold), var(--gold-light));
    transform: scaleX(0);
    transform-origin: left;
    transition: transform 0.4s ease;
}
.service-card:hover::before {
    transform: scaleX(1);
}
.service-card:hover {
    transform: translateY(-8px);
    box-shadow: 0 16px 48px rgba(0, 0, 0, 0.12);
    border-color: rgba(201, 168, 76, 0.2);
}
.service-card i {
    font-size: 2.4rem;
    color: var(--gold);
    margin-bottom: 16px;
    display: block;
    transition: transform 0.3s ease;
}
.service-card:hover i {
    transform: scale(1.1);
}
.service-card h3 {
    font-family: 'Playfair Display', serif;
    font-size: 1.2rem;
    margin-bottom: 10px;
    color: var(--charcoal);
    font-weight: 600;
}
.service-card p {
    color: #666;
    font-size: 0.95rem;
    line-height: 1.6;
    margin: 0;
}

/* ===== FACILITY ITEM ENHANCEMENTS ===== */
.facility-item {
    border-radius: var(--radius-sm);
    padding: 28px 24px;
    background: linear-gradient(135deg, #fefcf7 0%, #f5f2ed 100%);
    border: 1px solid rgba(201, 168, 76, 0.1);
    text-align: center;
    transition: all 0.4s ease;
}
.facility-item:hover {
    background: linear-gradient(135deg, #fff 0%, #fcf8f0 100%);
    border-color: rgba(201, 168, 76, 0.3);
    transform: translateY(-6px);
    box-shadow: 0 12px 40px rgba(201, 168, 76, 0.15);
}
.facility-item i {
    font-size: 2rem;
    color: var(--gold);
    margin-bottom: 12px;
    display: block;
}
.facility-item h4 {
    font-size: 1rem;
    font-weight: 600;
    color: var(--charcoal);
    margin-bottom: 6px;
}
.facility-item p {
    font-size: 0.88rem;
    color: #777;
    margin: 0;
}

/* ===== CTA BUTTONS HIERARCHY ===== */
.btn {
    transition: all 0.3s cubic-bezier(0.25, 0.46, 0.45, 0.94);
    position: relative;
    overflow: hidden;
}
.btn::before {
    content: '';
    position: absolute;
    inset: 0;
    background: rgba(255, 255, 255, 0.2);
    transform: scaleX(0);
    transform-origin: right;
    transition: transform 0.4s ease;
    z-index: -1;
}
.btn:hover::before {
    transform: scaleX(1);
    transform-origin: left;
}
.btn-primary {
    background: linear-gradient(135deg, var(--gold), var(--gold-light));
    color: #fff;
    font-weight: 600;
    box-shadow: 0 8px 28px rgba(201, 168, 76, 0.25);
}
.btn-primary:hover {
    transform: translateY(-3px);
    box-shadow: 0 12px 40px rgba(201, 168, 76, 0.4);
}
.btn-outline {
    border: 2px solid var(--charcoal);
    color: var(--charcoal);
    background: transparent;
}
.btn-outline:hover {
    background: var(--charcoal);
    color: #fff;
    transform: translateY(-3px);
}
.btn-white {
    background: rgba(255, 255, 255, 0.12);
    color: #fff;
    border: 1px solid rgba(255, 255, 255, 0.25);
    backdrop-filter: blur(8px);
}
.btn-white:hover {
    background: rgba(255, 255, 255, 0.22);
    transform: translateY(-3px);
}

/* ===== ICON INDICATORS ===== */
.icon-check {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 24px;
    height: 24px;
    border-radius: 50%;
    background: rgba(46, 204, 113, 0.2);
    color: #2ecc71;
    font-size: 0.85rem;
    flex-shrink: 0;
}

/* ===== RESPONSIVE (Issue 22) ===== */
@media (max-width: 992px) {
    .page-header { padding: 120px 0 32px; }
    .section { padding: 56px 0; }
    .section-intro {
        margin-bottom: 48px;
    }
    .section-intro h2 {
        font-size: 2rem;
    }
}

@media (max-width: 768px) {
    .page-header { padding: 110px 0 28px; }
    .section { padding: 44px 0; }
    .section-intro {
        margin-bottom: 40px;
    }
    .section-intro h2 {
        font-size: 1.8rem;
    }
    .section-intro p {
        font-size: 0.95rem;
    }
    .service-card {
        padding: 28px 20px;
    }
    .facility-item {
        padding: 20px 16px;
    }
    .service-card i,
    .facility-item i {
        font-size: 1.8rem;
    }
    .footer-grid { grid-template-columns: 1fr 1fr !important; }
    .nav-links.open {
        background: rgba(255, 252, 247, 0.99);
        border-radius: 16px;
        box-shadow: 0 12px 40px rgba(0, 0, 0, 0.12);
        padding: 16px;
    }
    .navbar-solid .nav-links.open {
        background: rgba(255, 252, 247, 0.99);
    }
    .nav-links.open a {
        color: var(--charcoal) !important;
        padding: 8px 0;
    }
}

@media (max-width: 560px) {
    .footer-grid { grid-template-columns: 1fr !important; }
    .float-buttons { bottom: 14px; right: 12px; gap: 8px; }
    .section-intro h2 {
        font-size: 1.5rem;
    }
    .service-card {
        padding: 24px 16px;
    }
    .facility-item {
        padding: 16px 12px;
    }
    .error-page {
        padding: 100px 20px 40px;
    }
    .error-page .error-code {
        font-size: 6rem;
    }
}
    .float-btn { width: 44px; height: 44px; font-size: 1.2rem; }
    .gallery-grid { grid-template-columns: 1fr 1fr; gap: 12px; }
    .page-header .section-title { font-size: 2rem !important; }
}

@media (max-width: 380px) {
    .gallery-grid { grid-template-columns: 1fr; }
    .float-buttons { bottom: 14px; right: 12px; }
}

/* ===== ACCESSIBILITY (Issue 26) ===== */
.btn:focus-visible,
a:focus-visible,
.gallery-item:focus-visible,
.float-btn:focus-visible {
    outline: 2px solid var(--gold);
    outline-offset: 3px;
}
.skip-link {
    position: absolute;
    left: -999px;
    top: 0;
    background: var(--charcoal);
    color: #fff;
    padding: 10px 18px;
    z-index: 10000;
    border-radius: 0 0 8px 0;
    text-decoration: none;
}
.skip-link:focus {
    left: 0;
}

/* ===== REDUCED MOTION ===== */
@media (prefers-reduced-motion: reduce) {
    .float-btn.whatsapp::after { animation: none; }
}
