/*
Theme Name: Aalayam
Theme URI: https://www.bytesbrothers.com/aalayam
Author: Bytes Brothers
Author URI: https://www.bytesbrothers.com
Description: A configurable South-Indian temple theme. Colors, fonts, logo and contact details are set from the Customizer, so a single codebase can power many temple websites. Pairs with the Aalayam Kit plugin for pooja timings, events and gallery. Tamil-first with full multilingual support via Polylang.
Version: 0.1.0-dev
Requires at least: 6.0
Tested up to: 6.7
Requires PHP: 8.0
License: GNU General Public License v2 or later
License URI: https://www.gnu.org/licenses/gpl-2.0.html
Text Domain: aalayam
Tags: temple, hindu, tamil, south-indian, translation-ready, custom-colors, custom-logo, custom-menu
*/

/* ============================================================
   1. CSS CUSTOM PROPERTIES — DESIGN SYSTEM
   The values below are FALLBACK DEFAULTS. The Customizer emits an
   inline :root block (see inc/dynamic-css.php) that overrides any
   of these per-site, so a single stylesheet powers many temples.
   ============================================================ */
:root {
    /* Brand Colors */
    --color-primary:        #b83f3f;
    --color-primary-dark:   #7d2b2b;
    --color-primary-light:  #d46060;
    --color-secondary:      #C8A951;
    --color-gold-dark:      #9A7B30;
    --color-gold-light:     #E5C97A;
    --color-accent:         #E8572A;
    --color-accent-light:   #F07A50;
    --color-bg:             #F9F3EB;
    --color-bg-dark:        #F9F1E1;
    --color-text:           #2C1810;
    --color-text-muted:     #6B4C3B;
    --color-white:          #FFFFFF;
    --color-black:          #000000;
    --color-border:         #E0C88A;
    /* Top bar. The base colors are solid; the muting (85/70/20%) lives in the
       rules themselves, since the Customizer's picker is hex-only. */
    --color-top-bar-bg:     #7D2B2B;
    --color-top-bar-text:   #FFFFFF;
    --color-top-bar-link:   #FFFFFF;
    --color-top-bar-icon:   #FFFFFF;
    --color-top-bar-ring:   #FFFFFF;  /* social icon border */
    /* Language switcher (styled in assets/css/temple-patterns.css).
       Pill sits on the top bar; the dropdown panel has its own background. */
    --color-lang-text:      #E5C97A;  /* current-language label + caret */
    --color-lang-pill-bg:   #FFFFFF;  /* muted to 6% */
    --color-lang-ring:      #C8A951;  /* muted to 40% */
    --color-lang-panel-bg:  #7D2B2B;
    --color-lang-item:      #FFFFFF;  /* muted to 85% */
    --color-header-bg:      #F9F1E1; /*#F7F2EC;*/
    /* Header chrome — sits on --color-header-bg (light), so these are dark.
       The dropdown keeps its own token: it sits on --color-primary-dark. */
    --color-nav-link:       #7D2B2B;
    --color-nav-hover:      #B83F3F;
    --color-nav-sub-link:   #FFFFFF;

    /* Typography */
    --font-heading:  'Tiro Tamil', 'Playfair Display', Georgia, serif;
    --font-body:     'Pavanam','Noto Serif', Georgia, serif;
    --font-tamil-tiro: 'Tiro Tamil', 'Latha', serif;
    --font-tamil:    'Pavanam', 'Latha', serif;
    /* Body-copy Tamil face (self-hosted, 400 only — see assets/fonts/fonts.css). */
    --font-tamil-noto: 'Noto Sans Tamil', 'Pavanam', 'Latha', sans-serif;
    --font-english:   'Playfair Display', Georgia, serif;
    --font-ui:       Arial, Tahoma, Verdana, sans-serif;
    /* Repointed per page language by inc/dynamic-css.php (--font-nav-ta/-en). */
    --font-nav:      var(--font-tamil-tiro);

    /* Section bands & surfaces (v2 design system — design-mockups/homepage-v2.html) */
    --v2-band-today: #F2E8D8;   /* sand — the panchangam strip */
    --v2-cream:      #FFFDF8;   /* card surface on the sand band */
    --v2-sand:       #F4E9D7;

    /* Spacing */
    --space-xs:   0.25rem;
    --space-sm:   0.5rem;
    --space-md:   1rem;
    --space-lg:   2rem;
    --space-xl:   4rem;
    --space-2xl:  6rem;

    /* Layout */
    --container-max: 1200px;
    --container-pad: 1.5rem;

    /* Borders & Radius */
    --border-gold:         2px solid var(--color-secondary);
    --border-gold-thick:   4px solid var(--color-secondary);
    --border-light:        1px solid var(--color-border);
    --radius-sm:  4px;
    --radius-md:  8px;
    --radius-lg:  16px;

    /* Shadows */
    --shadow-sm:    0 2px 8px rgba(184, 63, 63, 0.1);
    --shadow-card:  0 4px 20px rgba(184, 63, 63, 0.15);
    --shadow-lg:    0 8px 40px rgba(0, 0, 0, 0.2);

    /* Transitions */
    --transition-fast:   0.15s ease;
    --transition-normal: 0.3s ease;
}

/* ============================================================
   2. CSS RESET
   ============================================================ */
*, *::before, *::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

html {
    scroll-behavior: smooth;
    font-size: 16px;
}

body {
    font-family: var(--font-body);
    font-size: 1rem;
    line-height: 1.7;
    color: var(--color-text);
    background-color: var(--color-bg);
    -webkit-font-smoothing: antialiased;
}

img {
    max-width: 100%;
    height: auto;
    display: block;
}

a {
    color: var(--color-primary);
    text-decoration: none;
    transition: color var(--transition-fast);
}

a:hover {
    color: var(--color-primary-dark);
}

ul, ol {
    list-style: none;
}

/* ============================================================
   3. TYPOGRAPHY
   ============================================================ */
h1, h2, h3, h4, h5, h6 {
    font-family: var(--font-heading);
    font-weight: 700;
    line-height: 1.3;
    color: var(--color-text);
}

h1 { font-size: clamp(1.8rem, 4vw, 3rem); }
h2 { font-size: clamp(1.4rem, 3vw, 2.2rem); }
h3 { font-size: clamp(1.2rem, 2.5vw, 1.6rem); }
h4 { font-size: 1.2rem; }
h5 { font-size: 1.1rem; }
h6 { font-size: 1rem; }

p { margin-bottom: var(--space-md); }
p:last-child { margin-bottom: 0; }

/* Tamil text */
[lang="ta"],
.tamil-text {
    font-family: var(--font-tamil);
    line-height: 1.9;
}

.section-title {
    font-family: var(--font-heading);
    text-align: center;
    color: var(--color-primary);
    margin-bottom: var(--space-lg);
    position: relative;
    padding-bottom: 0.75rem;
}

.section-title::after {
    content: '';
    display: block;
    width: 60px;
    height: 3px;
    background: var(--color-secondary);
    margin: 0.5rem auto 0;
    border-radius: 2px;
}

.section-subtitle {
    text-align: center;
    color: var(--color-text-muted);
    font-size: 1rem;
    margin-top: -1rem;
    margin-bottom: var(--space-lg);
    font-family: var(--font-tamil);
}

.font-heading { font-family: var(--font-heading); }

/* ============================================================
   4. LAYOUT UTILITIES
   ============================================================ */
.container {
    max-width: var(--container-max);
    margin: 0 auto;
    padding: 0 var(--container-pad);
}

.section-padding {
    padding: var(--space-xl) 0;
}

.section-padding-sm {
    padding: var(--space-lg) 0;
}

.text-center { text-align: center; }
.text-left   { text-align: left; }
.text-right  { text-align: right; }

/* ============================================================
   5. BUTTONS
   ============================================================ */
.btn {
    display: inline-block;
    padding: 0.75rem 1.75rem;
    border-radius: var(--radius-sm);
    font-family: var(--font-heading);
    font-size: 0.9rem;
    font-weight: 600;
    letter-spacing: 0.05em;
    text-transform: uppercase;
    cursor: pointer;
    border: 2px solid transparent;
    transition: all var(--transition-normal);
    text-decoration: none;
}

.btn-primary {
    background: var(--color-primary);
    color: var(--color-white);
    border-color: var(--color-primary);
}

.btn-primary:hover {
    background: var(--color-primary-dark);
    border-color: var(--color-primary-dark);
    color: var(--color-white);
}

.btn-gold {
    background: var(--color-secondary);
    color: var(--color-text);
    border-color: var(--color-secondary);
}

.btn-gold:hover {
    background: var(--color-gold-dark);
    border-color: var(--color-gold-dark);
    color: var(--color-white);
}

.btn-outline-white {
    background: transparent;
    color: var(--color-white);
    border-color: var(--color-white);
}

.btn-outline-white:hover {
    background: var(--color-white);
    color: var(--color-primary);
}

.btn-outline-gold {
    background: transparent;
    color: var(--color-secondary);
    border-color: var(--color-secondary);
}

.btn-outline-gold:hover {
    background: var(--color-secondary);
    color: var(--color-text);
}

/* ============================================================
   6. TOP BAR
   ============================================================ */
.top-bar {
    background: var(--color-top-bar-bg);
    color: var(--color-top-bar-text);
    color: color-mix(in srgb, var(--color-top-bar-text) 85%, transparent);
    font-size: 0.8rem;
    font-family: var(--font-ui);
    padding: 0.4rem 0;
    border-bottom: 1px solid rgba(200, 169, 81, 0.3);
}

.top-bar-inner {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: var(--space-md);
}

.top-bar-contact {
    display: flex;
    align-items: center;
    gap: var(--space-lg);
}

.top-bar-contact a {
    color: var(--color-top-bar-link);
    color: color-mix(in srgb, var(--color-top-bar-link) 85%, transparent);
    display: flex;
    align-items: center;
    gap: 0.3rem;
}

.top-bar-contact a:hover {
    color: var(--color-gold-light);
}

.top-bar-social {
    display: flex;
    align-items: center;
    gap: var(--space-sm);
}

.top-bar-social a {
    color: var(--color-top-bar-icon);
    color: color-mix(in srgb, var(--color-top-bar-icon) 70%, transparent);
    width: 26px;
    height: 26px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    border: 1px solid var(--color-top-bar-ring);
    border: 1px solid color-mix(in srgb, var(--color-top-bar-ring) 20%, transparent);
    font-size: 0.75rem;
    transition: all var(--transition-fast);
}

.top-bar-social a:hover {
    background: var(--color-secondary);
    border-color: var(--color-secondary);
    color: var(--color-text);
}

/* ============================================================
   7. HEADER & NAVIGATION
   ============================================================ */
.site-header {
    background: var(--color-header-bg);
    position: sticky;
    top: 0;
    z-index: 100;
    box-shadow: 0 2px 12px rgba(0, 0, 0, 0.2);
    /* needed so mobile dropdown positions relative to header */
    overflow: visible;
}

.primary-nav {
    position: relative;
}

.header-inner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0.275rem;
    max-width: var(--container-max);
    margin: 0 auto;
    gap: var(--space-lg);
}

/* Logo */
.site-logo {
    flex-shrink: 0;
    display: flex;
    align-items: center;
    gap: var(--space-sm);
    text-decoration: none;
}

.site-logo img {
    height: 70px;
    width: auto;
    object-fit: contain;
}

.temple-name-wrap {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.temple-name-en {
    font-family: var(--font-english);
    font-size: 0.95rem;
    color: var(--color-nav-link);
    font-weight: 700;
    line-height: 1.2;
    letter-spacing: 0.02em;
}

.temple-name-tamil {
    font-family: var(--font-tamil-tiro);
    font-size: 0.85rem;
    font-weight: 700;
    /* Fallback first: browsers without color-mix() keep the solid tint. */
    color: var(--color-accent-light);
    color: color-mix(in srgb, var(--color-primary) 75%, transparent);
    line-height: 1.4;
}

/* Primary Navigation */
.primary-nav {
    display: flex;
    align-items: center;
}

.nav-menu {
    display: flex;
    align-items: center;
    gap: 0;
    list-style: none;
    margin: 0;
    padding: 0;
}

.nav-menu > li {
    position: relative;
}

.nav-menu > li > a {
    display: block;
    padding: 0.75rem 0.65rem;
    color: var(--color-nav-link);
    font-family: var(--font-nav);
    font-size: .85rem;
    font-weight: 500;
    letter-spacing: 0;
    transition: color var(--transition-fast);
    white-space: nowrap;
}

.nav-menu > li > a:hover,
.nav-menu > li.current-menu-item > a,
.nav-menu > li.current-menu-parent > a {
    color: var(--color-nav-hover);
}

/* Dropdown */
.nav-menu .sub-menu {
    position: absolute;
    top: 100%;
    left: 0;
    background: var(--color-primary-dark);
    min-width: 200px;
    padding: var(--space-sm) 0;
    border-top: 3px solid var(--color-secondary);
    box-shadow: var(--shadow-lg);
    opacity: 0;
    visibility: hidden;
    transform: translateY(-8px);
    transition: all var(--transition-normal);
    z-index: 200;
    list-style: none;
}

.nav-menu li:hover > .sub-menu {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.nav-menu .sub-menu li a {
    display: block;
    padding: 0.6rem 1.25rem;
    color: var(--color-nav-sub-link);
    font-family: var(--font-nav);
    font-size: 0.875rem;
    transition: all var(--transition-fast);
    border-left: 3px solid transparent;
}

.nav-menu .sub-menu li a:hover {
    color: var(--color-gold-light);
    background: rgba(255, 255, 255, 0.05);
    border-left-color: var(--color-secondary);
    padding-left: 1.5rem;
}

/* Hamburger / Mobile Toggle */
.nav-toggle {
    display: none;
    background: none;
    border: 2px solid rgba(255, 255, 255, 0.5);
    border-radius: var(--radius-sm);
    cursor: pointer;
    padding: 0.4rem 0.6rem;
    flex-direction: column;
    gap: 5px;
}

.nav-toggle span {
    display: block;
    width: 22px;
    height: 2px;
    background: var(--color-white);
    transition: all var(--transition-normal);
}

.nav-toggle.active span:nth-child(1) {
    transform: rotate(45deg) translate(5px, 5px);
}

.nav-toggle.active span:nth-child(2) {
    opacity: 0;
}

.nav-toggle.active span:nth-child(3) {
    transform: rotate(-45deg) translate(5px, -5px);
}

/* Gold border under header */
.header-gold-border {
    height: 4px;
    background: linear-gradient(90deg, transparent, var(--color-secondary), var(--color-accent), var(--color-secondary), transparent);
}

/* ============================================================
   8. HERO SECTION
   ============================================================ */
.hero-section {
    position: relative;
    min-height: 100vh;
    background: var(--color-primary-dark) center/cover no-repeat;
    display: flex;
    align-items: center;
    justify-content: center;
    text-align: center;
    overflow: hidden;
}

.hero-overlay {
    position: absolute;
    inset: 0;
    background: linear-gradient(to bottom, rgb(107 107 107 / 55%) 0%, rgb(77 77 77 / 70%) 50%, rgb(53 53 53 / 85%) 100%)
}

.hero-content {
    position: relative;
    z-index: 2;
    padding: var(--space-xl) var(--container-pad);
    max-width: 900px;
    margin: 0 auto;
}

.hero-om {
    font-size: 3rem;
    color: var(--color-secondary);
    margin-bottom: var(--space-md);
    text-shadow: 0 0 20px rgba(200, 169, 81, 0.5);
    animation: glow-pulse 3s ease-in-out infinite;
}

@keyframes glow-pulse {
    0%, 100% { text-shadow: 0 0 20px rgba(200, 169, 81, 0.5); }
    50%       { text-shadow: 0 0 40px rgba(200, 169, 81, 0.9), 0 0 60px rgba(200, 169, 81, 0.4); }
}

.hero-title-tamil {
    font-family: var(--font-tamil-tiro);
    font-size: clamp(1.6rem, 4vw, 2.5rem);
    color: var(--color-gold-light);
    text-shadow: 2px 1px 4px rgba(0, 0, 0, 0.8);
    line-height: 1.5;
    margin-bottom: var(--space-sm);
}

.hero-subtitle-tamil {
    font-family: var(--font-tamil-tiro);
    font-size: clamp(1rem, 2.5vw, 1.5rem);
    color: rgba(255, 255, 255, 0.85);
    margin-bottom: var(--space-sm);
}

.hero-subtitle-en {
    font-family: var(--font-heading);
    font-size: clamp(0.85rem, 1.5vw, 1.1rem);
    color: rgba(255, 255, 255, 0.7);
    letter-spacing: 0.15em;
    text-transform: uppercase;
    margin-bottom: var(--space-lg);
}

.hero-divider {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: var(--space-sm);
    margin: var(--space-md) 0 var(--space-lg);
    color: var(--color-secondary);
    font-size: 1.2rem;
}

.hero-divider::before,
.hero-divider::after {
    content: '';
    flex: 1;
    max-width: 120px;
    height: 1px;
    background: linear-gradient(to right, transparent, var(--color-secondary));
}

.hero-divider::after {
    background: linear-gradient(to left, transparent, var(--color-secondary));
}

.hero-ctas {
    display: flex;
    gap: var(--space-md);
    justify-content: center;
    flex-wrap: wrap;
}

/* ============================================================
   9. WELCOME STRIP
   ============================================================ */
.welcome-strip {
    background: var(--color-primary);
    padding: var(--space-lg) 0;
}

.welcome-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 0;
    text-align: center;
    color: var(--color-white);
}

.welcome-item {
    padding: var(--space-lg) var(--space-md);
    border-right: 1px solid rgba(255, 255, 255, 0.15);
}

.welcome-item:last-child {
    border-right: none;
}

.welcome-icon {
    font-size: 2.5rem;
    color: var(--color-secondary);
    margin-bottom: var(--space-sm);
}

.welcome-item h3 {
    color: var(--color-gold-light);
    font-family: var(--font-heading);
    font-size: 1rem;
    margin-bottom: var(--space-xs);
}

.welcome-item p {
    font-size: 0.875rem;
    color: rgba(255, 255, 255, 0.8);
    line-height: 1.6;
    margin: 0;
}

/* ============================================================
   10. TODAY SECTION (Pooja Timings + Events)
   ============================================================ */
.today-section {
    background: var(--color-bg);
    padding: var(--space-xl) 0;
}

.today-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: var(--space-xl);
    align-items: start;
}

/* ============================================================
   11. POOJA TIMINGS
   ============================================================ */
.pooja-timings-widget {
    background: var(--color-white);
    border: var(--border-light);
    border-top: var(--border-gold-thick);
    border-radius: var(--radius-md);
    overflow: hidden;
    box-shadow: var(--shadow-card);
}

.widget-header {
    background: var(--color-primary);
    padding: var(--space-md) var(--space-lg);
    display: flex;
    align-items: center;
    gap: var(--space-sm);
}

.widget-header h3 {
    color: var(--color-gold-light);
    font-family: var(--font-heading);
    font-size: 1rem;
    margin: 0;
}

.widget-header .header-icon {
    color: var(--color-secondary);
    font-size: 1.2rem;
}

.pooja-table {
    width: 100%;
    border-collapse: collapse;
}

.pooja-table th {
    background: var(--color-bg-dark);
    padding: 0.6rem 1rem;
    text-align: left;
    font-family: var(--font-body);
    font-size: 0.8rem;
    font-weight: 700;
    color: var(--color-text-muted);
    text-transform: uppercase;
    letter-spacing: 0.05em;
    border-bottom: var(--border-light);
}

.pooja-table td {
    padding: 0.75rem 1rem;
    border-bottom: var(--border-light);
    font-size: 0.9rem;
}

.pooja-table tr:last-child td {
    border-bottom: none;
}

.pooja-table tr:hover td {
    background: var(--color-bg);
}

.pooja-type-badge {
    display: inline-block;
    padding: 0.2rem 0.6rem;
    border-radius: 20px;
    font-size: 0.75rem;
    font-weight: 600;
}

.pooja-type-morning  { background: #FFF3CD; color: #856404; }
.pooja-type-noon     { background: #D1ECF1; color: #0C5460; }
.pooja-type-evening  { background: #FFE5CC; color: #7D3C00; }
.pooja-type-night    { background: #D6D8F7; color: #2D3270; }

.pooja-time {
    font-weight: 600;
    color: var(--color-primary);
    font-family: var(--font-ui);
    font-size: 0.875rem;
}

/* ============================================================
   12. EVENTS GRID
   ============================================================ */
.events-widget {
    background: var(--color-white);
    border: var(--border-light);
    border-top: var(--border-gold-thick);
    border-radius: var(--radius-md);
    overflow: hidden;
    box-shadow: var(--shadow-card);
}

.event-card {
    display: flex;
    gap: var(--space-md);
    padding: var(--space-md) var(--space-lg);
    border-bottom: var(--border-light);
    text-decoration: none;
    transition: background var(--transition-fast);
}

.event-card:last-child {
    border-bottom: none;
}

.event-card:hover {
    background: var(--color-bg);
}

.event-date-box {
    flex-shrink: 0;
    width: 52px;
    height: 52px;
    background: var(--color-primary);
    border-radius: var(--radius-sm);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    color: var(--color-white);
}

.event-date-day {
    font-size: 1.3rem;
    font-weight: 700;
    line-height: 1;
    font-family: var(--font-heading);
}

.event-date-month {
    font-size: 0.65rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--color-gold-light);
    font-family: var(--font-ui);
}

.event-info h4 {
    font-size: 0.9rem;
    color: var(--color-text);
    margin-bottom: 0.2rem;
    font-family: var(--font-body);
}

.event-info p {
    font-size: 0.8rem;
    color: var(--color-text-muted);
    margin: 0;
    font-family: var(--font-tamil);
}

/* ============================================================
   13. TEMPLE CARDS
   ============================================================ */
.temple-card {
    background: var(--color-white);
    border: 1px solid var(--color-border);
    border-top: 4px solid var(--color-secondary);
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-card);
    padding: var(--space-lg);
    transition: transform var(--transition-normal), box-shadow var(--transition-normal);
}

.temple-card:hover {
    transform: translateY(-4px);
    box-shadow: var(--shadow-lg);
}

/* ============================================================
   14. DEITIES SECTION
   ============================================================ */
.deities-section {
    background: var(--color-bg-dark);
    padding: var(--space-xl) 0;
    position: relative;
}

.deities-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: var(--space-xl);
}

.deity-card {
    background: var(--color-white);
    border-radius: var(--radius-lg);
    overflow: hidden;
    box-shadow: var(--shadow-card);
    text-align: center;
    transition: transform var(--transition-normal);
}

.deity-card:hover {
    transform: translateY(-6px);
}

.deity-card-image {
    height: 300px;
    overflow: hidden;
    background: var(--color-bg-dark);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 4rem;
}

.deity-card-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.deity-card-body {
    padding: var(--space-lg);
    border-top: 4px solid var(--color-secondary);
}

.deity-name-tamil {
    font-family: var(--font-tamil);
    font-size: 1.4rem;
    color: var(--color-primary);
    margin-bottom: 0.25rem;
}

.deity-name-en {
    font-family: var(--font-heading);
    font-size: 1rem;
    color: var(--color-text-muted);
    margin-bottom: var(--space-sm);
    text-transform: uppercase;
    letter-spacing: 0.08em;
}

.deity-desc {
    font-size: 0.9rem;
    color: var(--color-text-muted);
    line-height: 1.7;
}

/* ============================================================
   15. GALLERY GRID
   ============================================================ */
.gallery-preview-section {
    padding: var(--space-xl) 0;
    background: var(--color-bg);
}

.gallery-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 0.75rem;
}

.gallery-item {
    position: relative;
    overflow: hidden;
    border-radius: var(--radius-sm);
    aspect-ratio: 1;
    background: var(--color-bg-dark);
}

.gallery-item img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform var(--transition-normal);
}

.gallery-item:hover img {
    transform: scale(1.08);
}

.gallery-overlay {
    position: absolute;
    inset: 0;
    background: linear-gradient(to top, rgba(184, 63, 63, 0.85), transparent);
    opacity: 0;
    transition: opacity var(--transition-normal);
    display: flex;
    align-items: flex-end;
    padding: var(--space-md);
}

.gallery-item:hover .gallery-overlay {
    opacity: 1;
}

.gallery-title {
    color: var(--color-white);
    font-size: 0.875rem;
    font-family: var(--font-body);
    font-weight: 600;
}

/* Gallery Filters (full gallery page) */
.gallery-filters {
    display: flex;
    flex-wrap: wrap;
    gap: var(--space-sm);
    justify-content: center;
    margin-bottom: var(--space-lg);
}

.filter-btn {
    padding: 0.5rem 1.25rem;
    border: 2px solid var(--color-primary);
    background: transparent;
    color: var(--color-primary);
    border-radius: 20px;
    font-size: 0.875rem;
    cursor: pointer;
    transition: all var(--transition-fast);
    font-family: var(--font-body);
}

.filter-btn:hover,
.filter-btn.active {
    background: var(--color-primary);
    color: var(--color-white);
}

/* ============================================================
   16. DONATION CTA
   ============================================================ */
.donation-cta-section {
    background: linear-gradient(135deg, var(--color-primary-dark) 0%, var(--color-primary) 50%, var(--color-primary-dark) 100%);
    padding: var(--space-xl) 0;
    text-align: center;
    position: relative;
    overflow: hidden;
}

.donation-cta-section::before {
    content: 'ॐ';
    position: absolute;
    font-size: 20rem;
    color: rgba(255, 255, 255, 0.03);
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    pointer-events: none;
}

.donation-cta-section h2 {
    color: var(--color-gold-light);
    margin-bottom: var(--space-sm);
    font-family: var(--font-heading);
}

.donation-cta-section p {
    color: rgba(255, 255, 255, 0.8);
    max-width: 600px;
    margin: 0 auto var(--space-lg);
}

/* ============================================================
   17. PAGE BANNER (inner pages)
   ============================================================ */
.page-banner {
    background: linear-gradient(to right, var(--color-primary-dark), var(--color-primary));
    padding: var(--space-xl) 0;
    text-align: center;
    position: relative;
}

.page-banner::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    height: 4px;
    background: linear-gradient(90deg, transparent, var(--color-secondary), transparent);
}

.page-banner h1 {
    color: var(--color-gold-light);
    font-family: var(--font-heading);
    margin-bottom: var(--space-sm);
}

.breadcrumbs {
    font-size: 0.875rem;
    color: rgba(255, 255, 255, 0.65);
    font-family: var(--font-ui);
}

.breadcrumbs a {
    color: rgba(255, 255, 255, 0.65);
}

.breadcrumbs a:hover {
    color: var(--color-gold-light);
}

.breadcrumbs span {
    margin: 0 0.4rem;
}

/* ============================================================
   18. CONTENT AREA + SIDEBAR
   ============================================================ */
.page-content-section {
    padding: var(--space-xl) 0;
}

.content-grid {
    display: grid;
    grid-template-columns: 1fr 320px;
    gap: var(--space-xl);
    align-items: start;
}

.content-grid.full-width {
    grid-template-columns: 1fr;
}

.main-content .entry-content {
    font-size: 1rem;
    line-height: 1.8;
}

.main-content .entry-content h2,
.main-content .entry-content h3 {
    color: var(--color-primary);
    margin: var(--space-lg) 0 var(--space-sm);
    padding-bottom: 0.5rem;
    border-bottom: 2px solid var(--color-bg-dark);
}

.main-content .entry-content img {
    border-radius: var(--radius-md);
    margin: var(--space-md) 0;
}

.main-content .entry-content ul,
.main-content .entry-content ol {
    list-style: disc;
    padding-left: var(--space-lg);
    margin-bottom: var(--space-md);
}

.main-content .entry-content ul li,
.main-content .entry-content ol li {
    margin-bottom: 0.4rem;
}

/* Sidebar */
.content-sidebar .widget {
    background: var(--color-white);
    border: var(--border-light);
    border-top: 4px solid var(--color-secondary);
    border-radius: var(--radius-md);
    padding: var(--space-lg);
    margin-bottom: var(--space-lg);
    box-shadow: var(--shadow-sm);
}

.content-sidebar .widget-title {
    font-family: var(--font-heading);
    font-size: 1rem;
    color: var(--color-primary);
    margin-bottom: var(--space-md);
    padding-bottom: 0.5rem;
    border-bottom: 2px solid var(--color-bg-dark);
}

/* ============================================================
   19. FOOTER WIDGETS
   ============================================================ */
/* Maroon on parchment (design-mockups/homepage-v2.html). Tamil faces on
   Tamil pages; every other language falls back to the English face. */
.site-footer {
    --footer-font-title: var(--font-tamil-tiro);
    --footer-font-text:  var(--font-tamil-noto);
    background: var(--color-primary-dark) url('assets/images/footer-bg1b.webp');
    color: #5A3A2A;
}

html:not(:lang(ta)) .site-footer {
    --footer-font-title: var(--font-english);
    --footer-font-text:  var(--font-english);
}

.footer-widgets-area {
    padding: var(--space-xl) 0;
    border-bottom: 1px solid rgba(184, 63, 63, 0.2);
}

.footer-grid {
    display: grid;
    grid-template-columns: 1.6fr 1fr 1fr 1fr 1.25fr;
    gap: var(--space-lg);
}

.footer-widget-title,
.footer-col-title {
    font-family: var(--font-tamil-tiro);
    font-size: 1rem;
    font-weight: 600;
    color: var(--color-primary-dark);
    margin-bottom: var(--space-md);
    padding-bottom: 0.5rem;
    border-bottom: 1px solid rgba(184, 63, 63, 0.25);
    letter-spacing: 0;
    text-transform: none;
}

.footer-logo {
    margin-bottom: var(--space-md);
}

.footer-logo img {
    height: 70px;
    width: auto;
    opacity: 0.9;
}

.footer-about-text {
    font-family: var(--footer-font-text);
    font-size: 0.90rem;
    line-height: 1.9;
    color: #5A3A2A;
}

.footer-social {
    display: flex;
    gap: 0.5rem;
    margin-top: 1rem;
}

.footer-social a {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    border: 1px solid var(--color-secondary);
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--color-primary);
    font-size: 0.85rem;
    padding: 0;
}

.footer-social a:hover {
    background: var(--color-primary);
    color: #fff;
    border-color: var(--color-primary);
}

.footer-nav-list li {
    margin-bottom: 0.15rem;
}

/* Plain (non-link) rows, e.g. the timings in the contact column. */
.footer-nav-list li.plain {
    color: #5A3A2A;
    font-family: var(--footer-font-text);
    font-size: 0.90rem;
    line-height: 1.9;
}

.footer-nav-list a {
    color: var(--color-primary);
    font-family: var(--footer-font-text);
    font-size: 0.90rem;
    line-height: 1.9;
    transition: color var(--transition-fast);
    display: flex;
    align-items: center;
    gap: 0.4rem;
}

.footer-nav-list a::before {
    content: '›';
    color: var(--color-gold-dark);
}

.footer-nav-list a:hover {
    color: var(--color-primary-dark);
    padding-left: 4px;
}

.footer-contact-item {
    display: flex;
    gap: var(--space-sm);
    margin-bottom: var(--space-sm);
    font-family: var(--footer-font-text);
    font-size: 0.90rem;
    line-height: 1.9;
    color: #5A3A2A;
}

.footer-contact-icon {
    color: var(--color-gold-dark);
    flex-shrink: 0;
    margin-top: 2px;
}

.footer-contact-item a {
    color: var(--color-primary);
}

.footer-contact-item a:hover {
    color: var(--color-primary-dark);
}

/* ============================================================
   20. FOOTER BOTTOM BAR
   ============================================================ */
.footer-bottom {
    background: rgba(184, 63, 63, 0.10);
    padding: var(--space-md) 0;
}

.footer-bottom-inner {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: var(--space-md);
    flex-wrap: wrap;
}

.footer-copyright {
    font-size: 0.9rem;
    color: #6B4C3B;
    font-family: var(--footer-font-text);
}

.footer-bottom-nav {
    display: flex;
    gap: var(--space-lg);
}

.footer-bottom-nav a {
    font-size: 0.8rem;
    color: rgba(255, 255, 255, 0.5);
    font-family: var(--font-ui);
}

.footer-bottom-nav a:hover {
    color: var(--color-gold-light);
}

/* ============================================================
   21. AUDIO PLAYER (fixed bottom-right)
   ============================================================ */
.temple-audio-player {
    position: fixed;
    bottom: 24px;
    right: 24px;
    z-index: 9999;
    background: var(--color-primary);
    border: 2px solid var(--color-secondary);
    border-radius: 50px;
    box-shadow: var(--shadow-lg);
}

.audio-btn {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    background: none;
    border: none;
    color: var(--color-white);
    cursor: pointer;
    padding: 0.6rem 1rem;
    font-family: var(--font-ui);
    font-size: 0.85rem;
    border-radius: 50px;
    transition: background var(--transition-fast);
}

.audio-btn:hover {
    background: rgba(255, 255, 255, 0.1);
}

.audio-icon {
    color: var(--color-secondary);
    font-size: 1.1rem;
    min-width: 20px;
    text-align: center;
}

.audio-btn.playing .audio-icon {
    animation: pulse-music 1.5s ease-in-out infinite;
}

/* Play / Pause state icon — swaps via the .playing class (JS-driven) */
.audio-state {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 18px;
    font-size: 0.95rem;
    line-height: 1;
    color: var(--color-white);
}
.audio-state::before { content: "\25B6"; }              /* ▶ play  (shown when paused)  */
.audio-btn.playing .audio-state::before { content: "\23F8"; }  /* ⏸ pause (shown when playing) */

@keyframes pulse-music {
    0%, 100% { transform: scale(1); opacity: 1; }
    50%       { transform: scale(1.3); opacity: 0.8; }
}

.audio-label {
    color: rgba(255, 255, 255, 0.85);
    font-size: 0.8rem;
    white-space: nowrap;
}

/* ============================================================
   22. 404 PAGE
   ============================================================ */
.error-404 {
    text-align: center;
    padding: var(--space-2xl) var(--container-pad);
}

.error-404 .error-code {
    font-size: 8rem;
    font-family: var(--font-heading);
    color: var(--color-primary);
    line-height: 1;
    opacity: 0.15;
}

.error-404 h2 {
    font-family: var(--font-tamil);
    color: var(--color-primary);
    margin-bottom: var(--space-md);
}

/* ============================================================
   23. WORDPRESS ALIGNMENTS
   ============================================================ */
.alignleft  { float: left; margin: 0 var(--space-lg) var(--space-md) 0; }
.alignright { float: right; margin: 0 0 var(--space-md) var(--space-lg); }
.aligncenter { display: block; margin: 0 auto var(--space-md); }
.alignwide  { margin-left: -2rem; margin-right: -2rem; }
.alignfull  { margin-left: calc(-50vw + 50%); margin-right: calc(-50vw + 50%); }

.wp-caption {
    max-width: 100%;
    margin-bottom: var(--space-md);
}

.wp-caption-text {
    font-size: 0.875rem;
    color: var(--color-text-muted);
    text-align: center;
    padding: 0.4rem 0;
    font-style: italic;
}

/* ============================================================
   24. STYLE PREVIEW (temporary — Step 1 only)
   A small palette/typography preview used by the placeholder
   index.php so Customizer changes are visible before the real
   templates are ported in a later build step.
   ============================================================ */
.aalayam-preview { padding: var(--space-xl) 0; }
.aalayam-preview .swatches {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
    gap: var(--space-md);
    margin: var(--space-lg) 0;
}
.aalayam-swatch {
    border: var(--border-light);
    border-radius: var(--radius-md);
    overflow: hidden;
    box-shadow: var(--shadow-sm);
    font-family: var(--font-ui);
    font-size: 0.75rem;
}
.aalayam-swatch .chip { height: 64px; }
.aalayam-swatch .label { padding: 0.5rem; background: var(--color-white); color: var(--color-text); }
.aalayam-preview .btn { margin: 0.25rem; }

/* ============================================================
   25. RESPONSIVE — MOBILE
   ============================================================ */
@media (max-width: 1100px) {
    .footer-grid { grid-template-columns: 1fr 1fr 1fr; }
}

@media (max-width: 640px) {
    .footer-grid { grid-template-columns: 1fr; }
}

@media (max-width: 1024px) {
    .deities-grid {
        gap: var(--space-lg);
    }
}

/* Hide logo text on medium screens to give nav more room */
@media (max-width: 1380px) {
    .temple-name-wrap { display: none; }
    .site-logo img    { height: 60px; }
}

/* Hamburger breakpoint — all screens up to 1280px */
@media (max-width: 1280px) {
    :root {
        --space-xl: 2.5rem;
        --container-pad: 1rem;
    }

    /* Header */
    .nav-toggle {
        display: flex;
    }

    .primary-nav .nav-menu {
        display: none;
        position: absolute;
        top: 100%;
        left: 0;
        right: 0;
        background: var(--color-primary-dark);
        flex-direction: column;
        padding: var(--space-md) 0;
        box-shadow: var(--shadow-lg);
        border-top: 3px solid var(--color-secondary);
        z-index: 200;
    }

    .primary-nav .nav-menu.open {
        display: flex;
    }

    .nav-menu > li > a {
        padding: 0.75rem var(--container-pad);
        border-bottom: 1px solid rgba(255, 255, 255, 0.05);
        font-size: 0.9rem;
    }

    .nav-menu .sub-menu {
        position: static;
        opacity: 1;
        visibility: visible;
        transform: none;
        box-shadow: none;
        border-top: none;
        background: rgba(0, 0, 0, 0.2);
        padding: 0;
    }

    .nav-menu .sub-menu li a {
        padding-left: 2.5rem;
    }

    .temple-name-en {
        display: none;
    }

    /* Top bar */
    .top-bar-contact .address-item { display: none; }

    /* Audio player label hidden on small screens */
    .audio-label { display: none; }
}

/* Layout column collapses — tablet/mobile only */
@media (max-width: 768px) {
    /* Hero */
    .hero-section { min-height: 70vh; }
    .hero-ctas { flex-direction: column; align-items: center; }

    /* Welcome strip */
    .welcome-grid { grid-template-columns: 1fr; }
    .welcome-item { border-right: none; border-bottom: 1px solid rgba(255,255,255,0.15); }
    .welcome-item:last-child { border-bottom: none; }

    /* Today section */
    .today-grid { grid-template-columns: 1fr; }

    /* Deities */
    .deities-grid { grid-template-columns: 1fr; }

    /* Gallery */
    .gallery-grid { grid-template-columns: repeat(2, 1fr); }

    /* Content */
    .content-grid { grid-template-columns: 1fr; }

    /* Footer */
    .footer-bottom-inner { flex-direction: column; text-align: center; }

    /* Audio player */
    .temple-audio-player { bottom: 16px; right: 16px; }
}

@media (max-width: 480px) {
    .gallery-grid { grid-template-columns: 1fr 1fr; }
    .site-logo img { height: 52px; }
}
