/* ============================================================
   TIRUKKURAL — styles.css
   ============================================================ */

/* Reset & Base */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

:root {
    --primary-color: #d4380d;
    --secondary-color: #fa8c16;
    --dark-bg: #1f1f1f;
    --light-bg: #ffffff;
    --text-dark: #262626;
    --text-light: #595959;
    --border-color: #d9d9d9;
    --hover-bg: #fff7e6;
    --shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

html, body {
    overflow-x: hidden;
    max-width: 100%;
}

body {
    font-family: 'Segoe UI', 'Noto Sans Tamil', Tahoma, Geneva, Verdana, sans-serif;
    line-height: 1.8;
    color: var(--text-dark);
    background-color: #fafafa;
}

img, iframe, video {
    max-width: 100%;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
}

/* ============================================================
   HEADER
   ============================================================ */
.header {
    background: linear-gradient(135deg, var(--primary-color) 0%, var(--secondary-color) 100%);
    color: white;
    padding: 40px 20px;
    text-align: center;
    box-shadow: var(--shadow);
}

.header-content {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 30px;
    flex-wrap: wrap;
}

.header-content > a,
.header-link {
    display: flex;
    align-items: center;
    gap: 30px;
    text-decoration: none;
    color: white;
    flex-wrap: wrap;
    justify-content: center;
    transition: opacity 0.3s ease;
}

.header-content > a:hover,
.header-link:hover {
    opacity: 0.85;
}

.header-link .site-title,
.header-link .site-tagline,
.header-link .site-subtitle {
    color: white;
}

.site-logo {
    width: 80px;
    height: 80px;
    background: white;
    border-radius: 50%;
    padding: 10px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
    transition: transform 0.3s ease;
}

.site-logo:hover {
    transform: scale(1.1) rotate(5deg);
}

.header-text {
    text-align: center;
}

.site-title {
    font-size: 3rem;
    font-weight: 700;
    margin-bottom: 10px;
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.2);
}

.site-tagline {
    font-size: 1.3rem;
    margin-bottom: 5px;
    opacity: 0.95;
}

.site-subtitle {
    font-size: 1rem;
    opacity: 0.85;
}

/* ============================================================
   NAVIGATION
   ============================================================ */
.nav {
    background: var(--light-bg);
    box-shadow: var(--shadow);
    position: sticky;
    top: 0;
    z-index: 100;
}

.nav-container {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 15px 20px;
    gap: 20px;
}

.nav-links {
    display: flex;
    gap: 20px;
    flex: 1;
}

.nav-controls {
    display: flex;
    align-items: center;
    gap: 15px;
    margin-left: auto;
}

/* Hamburger — hidden on desktop */
.nav-hamburger {
    display: none;
    background: none;
    border: none;
    font-size: 1.6rem;
    cursor: pointer;
    color: var(--text-dark);
    padding: 4px 8px;
    border-radius: 6px;
    transition: background 0.2s;
    position: absolute;
    right: 16px;
    top: 50%;
    transform: translateY(-50%);
}

.nav-hamburger:hover {
    background: var(--hover-bg);
}

.nav-link {
    text-decoration: none;
    color: var(--text-dark);
    font-weight: 500;
    font-size: 1.1rem;
    padding: 8px 16px;
    border-radius: 6px;
    transition: all 0.3s ease;
}

.nav-link:hover {
    background: var(--hover-bg);
    color: var(--primary-color);
}

.nav-link.active {
    background: var(--primary-color);
    color: white;
}

.language-dropdown {
    padding: 8px 16px;
    border: 2px solid var(--border-color);
    border-radius: 8px;
    background: white;
    font-size: 1rem;
    cursor: pointer;
    transition: border-color 0.3s ease;
    font-family: inherit;
    min-width: 150px;
}

.language-dropdown:hover {
    border-color: var(--primary-color);
}

.language-dropdown:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(212, 56, 13, 0.1);
}

.welcome-btn {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    border: 2px solid var(--primary-color);
    background: white;
    font-size: 1.2rem;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
}

.welcome-btn:hover {
    background: var(--primary-color);
    transform: scale(1.1);
}

/* ============================================================
   MAIN CONTENT
   ============================================================ */
.main-content {
    padding: 40px 20px;
    min-height: calc(100vh - 400px);
}

/* ── Intro Section ── */
.intro-section {
    background: white;
    padding: 30px;
    border-radius: 12px;
    box-shadow: var(--shadow);
    margin-bottom: 40px;
}

.intro-section h2 {
    color: var(--primary-color);
    font-size: 2rem;
    margin-bottom: 20px;
}

.intro-text {
    font-size: 1.1rem;
    line-height: 2;
    color: var(--text-light);
}

/* ── Thiruvalluvar Section ── */
.thiruvalluvar-section {
    margin-bottom: 40px;
}

.thiruvalluvar-card {
    background: linear-gradient(135deg, #fff9f0 0%, #ffffff 100%);
    padding: 40px;
    border-radius: 12px;
    box-shadow: var(--shadow);
    display: flex;
    align-items: center;
    gap: 40px;
    border-left: 6px solid var(--primary-color);
}

.thiruvalluvar-image {
    flex-shrink: 0;
}

.thiruvalluvar-image img {
    width: 150px;
    height: 150px;
    border-radius: 50%;
    background: white;
    padding: 15px;
    box-shadow: 0 6px 20px rgba(212, 56, 13, 0.2);
    transition: transform 0.3s ease;
}

.thiruvalluvar-image img:hover {
    transform: scale(1.05) rotate(5deg);
}

.thiruvalluvar-info {
    flex: 1;
}

.thiruvalluvar-info h3 {
    color: var(--primary-color);
    font-size: 2rem;
    margin-bottom: 5px;
}

.thiruvalluvar-title {
    color: var(--text-light);
    font-size: 1.2rem;
    font-style: italic;
    margin-bottom: 15px;
}

.thiruvalluvar-desc {
    color: var(--text-dark);
    line-height: 2;
    font-size: 1.05rem;
    margin-bottom: 20px;
}

.thiruvalluvar-stats {
    display: flex;
    gap: 15px;
    flex-wrap: wrap;
}

.stat-badge {
    background: var(--primary-color);
    color: white;
    padding: 8px 16px;
    border-radius: 20px;
    font-size: 0.9rem;
    font-weight: 600;
    box-shadow: 0 2px 6px rgba(212, 56, 13, 0.3);
}

/* ── Paal Section ── */
.paal-section {
    margin-bottom: 40px;
}

.paal-section h2 {
    color: var(--primary-color);
    font-size: 2rem;
    margin-bottom: 30px;
    text-align: center;
}

.paal-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 30px;
    margin-top: 30px;
}

.paal-card {
    background: white;
    padding: 30px;
    border-radius: 12px;
    box-shadow: var(--shadow);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    text-align: center;
    display: flex;
    flex-direction: column;
    align-items: center;
}

.paal-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.15);
}

.paal-icon {
    font-size: 3rem;
    margin-bottom: 15px;
}

.paal-card h3 {
    color: var(--primary-color);
    font-size: 1.8rem;
    margin-bottom: 10px;
}

.paal-header-link {
    text-decoration: none;
    color: inherit;
    transition: color 0.3s ease;
}

.paal-header-link:hover h3 {
    color: var(--secondary-color);
}

.paal-subtitle {
    color: var(--text-light);
    font-size: 1rem;
    font-style: italic;
    margin-bottom: 15px;
}

.paal-desc {
    color: var(--text-light);
    margin-bottom: 15px;
    line-height: 1.8;
}

.paal-count {
    font-weight: 600;
    color: var(--secondary-color);
    margin-bottom: 20px;
    margin-top: auto;
}
.paal-link {
    display: inline-block;
    background: var(--primary-color);
    color: white;
    text-decoration: none;
    padding: 12px 24px;
    border-radius: 6px;
    font-weight: 500;
    transition: all 0.3s ease;
}

.paal-link:hover {
    background: var(--secondary-color);
    transform: scale(1.05);
}

/* ── Stats Section ── */
.stats-section {
    padding: 24px 20px;
    background: white;
    border-top: 1px solid var(--border-color);
    border-bottom: 1px solid var(--border-color);
}

.stats-grid {
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    gap: 16px;
    text-align: center;
    max-width: 1200px;
    margin: 0 auto;
}

.stat-item {
    padding: 18px 10px;
    background: #fafafa;
    border: 1.5px solid var(--border-color);
    border-radius: 12px;
    box-shadow: 0 1px 6px rgba(0, 0, 0, 0.05);
}

.stat-item--visitors {
    background: linear-gradient(135deg, #fff7ed, #fff);
    border: 2px solid var(--primary-color);
    box-shadow: 0 2px 12px rgba(185, 74, 0, 0.10);
}

.stat-number {
    font-size: 2.4rem;
    font-weight: 700;
    color: var(--primary-color);
    margin-bottom: 4px;
}

.stat-label {
    font-size: 0.95rem;
    color: var(--text-dark);
    font-weight: 600;
    line-height: 1.3;
}

.stat-sublabel {
    font-size: 0.75rem;
    color: var(--text-light);
    margin-top: 2px;
}

/* ── Contributors Banner ── */
.contributors-banner {
    background: linear-gradient(135deg, var(--primary-color) 0%, var(--secondary-color) 100%);
    color: white;
    padding: 14px 20px;
}

.contributors-banner-inner {
    max-width: 1200px;
    margin: 0 auto;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    flex-wrap: wrap;
}

.contributors-banner-text {
    margin: 0;
    font-size: 0.93rem;
    opacity: 0.96;
    flex: 1;
    min-width: 220px;
    line-height: 1.5;
}

.contributors-banner-link {
    display: inline-flex;
    align-items: center;
    white-space: normal;
    word-break: break-word;
    padding: 8px 18px;
    background: rgba(255, 255, 255, 0.2);
    border: 2px solid rgba(255, 255, 255, 0.65);
    border-radius: 8px;
    color: white;
    font-weight: 700;
    text-decoration: none;
    font-size: 0.88rem;
    flex-shrink: 1;
    min-width: 0;
    transition: background 0.2s ease;
}

.contributors-banner-link:hover {
    background: rgba(255, 255, 255, 0.32);
}

/* ── Iyal Section (hidden by default — remove .hidden to enable) ── */
.iyal-section {
    padding: 32px 20px 40px;
    max-width: 1200px;
    margin: 0 auto;
}

.iyal-section.hidden {
    display: none;
}

.iyal-section-title {
    font-weight: 700;
    font-size: 1.35rem;
    color: var(--text-dark);
    margin-bottom: 20px;
    text-align: center;
}

.iyal-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 12px;
}

.iyal-card {
    border-radius: 10px;
    padding: 14px 16px;
    cursor: pointer;
    transition: transform 0.15s ease, box-shadow 0.15s ease;
    border: 1.5px solid transparent;
}

.iyal-card:hover {
    transform: translateY(-3px);
    box-shadow: 0 6px 18px rgba(0, 0, 0, 0.10);
}

.iyal-virtue { background: #fff7e6; border-color: #fa8c16; }
.iyal-wealth { background: #f0f9ff; border-color: #4096ff; }
.iyal-love   { background: #fff0f6; border-color: #eb2f96; }

.iyal-name {
    font-weight: 700;
    font-size: 0.98rem;
    margin-bottom: 2px;
    color: var(--text-dark);
}

.iyal-en {
    font-size: 0.78rem;
    color: var(--text-light);
    margin-bottom: 10px;
}

.iyal-meta {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.iyal-paal {
    font-size: 0.7rem;
    font-weight: 700;
    background: rgba(255, 255, 255, 0.75);
    border-radius: 10px;
    padding: 1px 8px;
}

.iyal-paal--virtue { color: #d46b08; }
.iyal-paal--wealth { color: #0958d9; }
.iyal-paal--love   { color: #c41d7f; }

.iyal-chapters {
    font-size: 0.7rem;
    color: #aaa;
}

/* ── Filter Tabs ── */
.filter-tabs {
    display: flex;
    gap: 10px;
    margin-bottom: 30px;
    flex-wrap: wrap;
}

.filter-tab {
    padding: 12px 24px;
    border: 2px solid var(--border-color);
    background: white;
    color: var(--text-dark);
    font-size: 1rem;
    font-weight: 500;
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.3s ease;
}

.filter-tab:hover {
    border-color: var(--primary-color);
    color: var(--primary-color);
}

.filter-tab.active {
    background: var(--primary-color);
    color: white;
    border-color: var(--primary-color);
}

/* ── Athikarams List ── */
.athikarams-list {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 20px;
}

.athikaram-card {
    background: white;
    padding: 20px;
    border-radius: 8px;
    box-shadow: var(--shadow);
    transition: all 0.3s ease;
    cursor: pointer;
    border-left: 4px solid var(--primary-color);
}

.athikaram-card:hover {
    transform: translateX(5px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

.athikaram-number {
    display: inline-block;
    background: var(--primary-color);
    color: white;
    padding: 4px 12px;
    border-radius: 4px;
    font-weight: 600;
    margin-bottom: 10px;
    font-size: 0.9rem;
}

.athikaram-title-ta {
    font-size: 1.3rem;
    font-weight: 600;
    color: var(--text-dark);
    margin-bottom: 5px;
}

.athikaram-title-en {
    font-size: 0.95rem;
    color: var(--text-light);
    font-style: italic;
}

.athikaram-range {
    font-size: 0.9rem;
    color: var(--secondary-color);
    margin-top: 10px;
    font-weight: 500;
}

/* ── Kural Display ── */
.kural-container {
    background: white;
    padding: 40px;
    border-radius: 12px;
    box-shadow: var(--shadow);
    margin-bottom: 30px;
}

.kural-header {
    text-align: center;
    margin-bottom: 40px;
    padding-bottom: 20px;
    border-bottom: 2px solid var(--border-color);
}

.kural-number {
    font-size: 1.2rem;
    color: var(--secondary-color);
    font-weight: 600;
    margin-bottom: 10px;
}

.athikaram-name {
    font-size: 1.5rem;
    color: var(--primary-color);
    font-weight: 600;
}

.kural-text-section {
    background: #fff9f0;
    padding: 20px;
    border-radius: 8px;
    margin-bottom: 30px;
    border-left: 4px solid var(--secondary-color);
}

.kural-tamil {
    font-size: 1.8rem;
    line-height: 1.3;
    color: var(--text-dark);
    font-weight: 500;
    margin-bottom: 8px;
    text-align: center;
    white-space: pre-line;
    word-break: break-word;
    overflow-wrap: break-word;
}

.kural-line {
    display: block;
    text-align: center;
    margin: 0;
}

.transliteration {
    font-size: 1.1rem;
    color: var(--text-dark);
    font-style: normal;
    font-weight: 500;
    text-align: center;
    margin-top: 5px;
    line-height: 1.3;
}

.transliteration-line {
    display: block;
    text-align: center;
    margin: 0;
}

.explanations-section {
    margin-top: 30px;
}

.explanation-item {
    background: white;
    padding: 20px;
    margin-bottom: 20px;
    border-radius: 8px;
    border-left: 4px solid var(--primary-color);
}

.explanation-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 10px;
}

.explanation-author {
    font-weight: 600;
    color: var(--primary-color);
    font-size: 1.1rem;
}

.explanation-translate-btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    background: linear-gradient(135deg, #4285f4 0%, #34a853 100%);
    color: white;
    border: none;
    padding: 8px 16px;
    border-radius: 20px;
    font-size: 0.9rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 2px 6px rgba(66, 133, 244, 0.3);
}

.explanation-translate-btn::before {
    content: "🌐";
    font-size: 1rem;
}

.explanation-translate-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 10px rgba(66, 133, 244, 0.4);
}

.explanation-text {
    color: var(--text-dark);
    line-height: 2;
    font-size: 1.05rem;
}

/* ── Kural Navigation Buttons ── */
.kural-navigation {
    display: flex;
    justify-content: space-between;
    gap: 20px;
    margin-top: 30px;
}

.nav-button {
    flex: 1;
    padding: 15px 30px;
    background: var(--primary-color);
    color: white;
    border: none;
    border-radius: 8px;
    font-size: 1.1rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s ease;
}

.nav-button:hover {
    background: var(--secondary-color);
    transform: scale(1.02);
}

.nav-button:disabled {
    background: var(--border-color);
    cursor: not-allowed;
    transform: none;
}

/* ── Loading State ── */
.loading {
    text-align: center;
    padding: 60px 20px;
    font-size: 1.2rem;
    color: var(--text-light);
}

/* ============================================================
   ATHIKARAM VIEW PAGE
   ============================================================ */
.athikaram-header-box {
    background: white;
    padding: 40px;
    border-radius: 12px;
    box-shadow: var(--shadow);
    text-align: center;
    position: relative;
    border: 2px solid #c8964a;
    box-shadow:
        0 0 0 5px white,
        0 0 0 7px #c8964a,
        0 0 0 12px white,
        0 0 0 13px rgba(200, 150, 74, 0.35);
    margin-bottom: 44px;
}

.athikaram-header-box::before,
.athikaram-header-box::after {
    content: '✦';
    position: absolute;
    color: #c8964a;
    font-size: 1.1rem;
    line-height: 1;
    background: white;
    padding: 2px 6px;
    left: 50%;
    transform: translateX(-50%);
}

.athikaram-header-box::before { top: -0.8em; }
.athikaram-header-box::after  { bottom: -0.8em; }


.athikaram-number-large {
    display: inline-block;
    background: var(--primary-color);
    color: white;
    padding: 8px 20px;
    border-radius: 6px;
    font-weight: 700;
    margin-bottom: 15px;
    font-size: 1.1rem;
}

.athikaram-title-large-ta {
    font-size: 2.2rem;
    color: var(--primary-color);
    font-weight: 700;
    margin-bottom: 10px;
}

.athikaram-title-large-en {
    font-size: 1.3rem;
    color: var(--text-light);
    font-style: italic;
    margin-bottom: 10px;
}

.athikaram-range-large {
    font-size: 1.1rem;
    color: var(--secondary-color);
    font-weight: 600;
}

/* ── Kurals List ── */
.kurals-list {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.kural-card {
    background: white;
    padding: 25px;
    border-radius: 10px;
    box-shadow: var(--shadow);
    transition: all 0.3s ease;
    border: 2px solid #d4a843;
    border-left: 5px solid var(--secondary-color);
}

.kural-card:hover {
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.15);
    transform: translateY(-2px);
}

.kural-card-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 15px;
}

.kural-view-btn {
    font-size: 0.78rem;
    font-weight: 600;
    color: var(--primary-color);
    text-decoration: none;
    border: 1px solid var(--primary-color);
    padding: 3px 10px;
    border-radius: 12px;
    transition: all 0.2s ease;
    white-space: nowrap;
}

.kural-view-btn:hover {
    background: var(--primary-color);
    color: white;
}

.kural-number-small {
    display: inline-block;
    background: var(--secondary-color);
    color: white;
    padding: 4px 12px;
    border-radius: 4px;
    font-weight: 600;
    font-size: 0.9rem;
}

.kural-text-section-compact {
    background: #fffdf5;
    padding: 22px 20px 18px;
    border-radius: 2px;
    margin-bottom: 20px;
    border: 3px double #c8961a;
    position: relative;
}

/* ✦ star ornaments centred on top and bottom border edges */
.kural-text-section-compact::before,
.kural-text-section-compact::after {
    content: '✦ ✦ ✦';
    position: absolute;
    left: 50%;
    transform: translateX(-50%);
    background: #fffdf5;
    padding: 0 10px;
    font-size: 0.72rem;
    color: #b8791a;
    letter-spacing: 4px;
    line-height: 1;
    white-space: nowrap;
}
.kural-text-section-compact::before { top: -0.6em; }
.kural-text-section-compact::after  { bottom: -0.6em; }


.kural-tamil-compact {
    font-size: 1.5rem;
    line-height: 1.4;
    color: var(--text-dark);
    font-weight: 500;
    margin-bottom: 0;
    text-align: center;
}

.kural-tamil-compact .kural-line {
    display: block;
}

.kural-separator {
    display: block;
    text-align: center;
    margin: 10px auto;
    color: var(--primary-color);
    opacity: 0.55;
    font-size: 1rem;
    letter-spacing: 0.18em;
    line-height: 1;
    user-select: none;
}

.transliteration-compact {
    font-size: 1.5rem;
    font-family: 'EB Garamond', Georgia, serif;
    color: #6b5a4e;
    font-style: italic;
    font-weight: 400;
    text-align: center;
    margin-top: 0;
    margin-bottom: 0;
    line-height: 1.4;
}

.ashraf-attribution {
    display: block;
    text-align: center;
    font-size: 0.78rem;
    font-style: italic;
    font-weight: normal;
    color: var(--text-light);
    margin-top: 8px;
}

.explanations-section-compact {
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.explanation-item-compact {
    background: #fafafa;
    padding: 15px;
    border-radius: 6px;
    border-left: 3px solid var(--primary-color);
    display: flex;
    flex-direction: column;
}

.explanation-author-small {
    font-weight: 600;
    color: var(--primary-color);
    font-size: 0.95rem;
}

.explanation-text-small {
    color: var(--text-dark);
    line-height: 1.8;
    font-size: 0.95rem;
    margin-top: 8px;
}

/* English commentary (Kannan / G.U. Pope) */
.explanation-item-compact.english-exp {
    background: #f7f9fd;
    border-left: 3px solid #4a7eb5;
}

.explanation-item-compact.english-exp .explanation-author-small {
    color: #4a7eb5;
}

.explanation-item-compact.english-exp .explanation-text-small {
    font-family: 'EB Garamond', Georgia, serif;
    font-style: italic;
    font-size: 1rem;
    color: #3d5a7a;
    margin-top: 6px;
}

.explanation-item-compact > .explanation-translate-btn {
    align-self: flex-end;
    margin-top: 10px;
}
/* ── Athikaram Navigation ── */
.athikaram-navigation {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 15px;
    margin-top: 40px;
    flex-wrap: wrap;
}

.athikaram-navigation-top {
    margin-top: 16px;
    margin-bottom: 24px;
}

.nav-button-link {
    flex: 0 0 auto;
    padding: 15px 30px;
    background: var(--border-color);
    color: var(--text-dark);
    border: none;
    border-radius: 8px;
    font-size: 1rem;
    font-weight: 500;
    text-decoration: none;
    display: inline-block;
    transition: all 0.3s ease;
}

.nav-button-link:hover {
    background: var(--text-light);
    color: white;
}

/* ============================================================
   ENGLISH TRANSLATION SECTION (Ashraf)
   ============================================================ */
.explanations-label {
    font-size: 1rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: var(--text-light);
    margin-bottom: 10px;
    padding-bottom: 6px;
    border-bottom: 1px solid var(--border-color);
}

.english-translate-btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    background: linear-gradient(135deg, #4285f4 0%, #34a853 100%);
    color: white;
    border: none;
    padding: 8px 16px;
    border-radius: 20px;
    font-size: 0.9rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 2px 6px rgba(66, 133, 244, 0.3);
    margin-left: auto;
    text-transform: none;
    letter-spacing: normal;
}

.english-translate-btn::before {
    content: "🌐";
    font-size: 1rem;
}

.english-translate-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 10px rgba(66, 133, 244, 0.4);
}

.attribution-link {
    color: #2563eb;
    text-decoration: none;
    font-weight: 600;
}

.attribution-link:hover {
    text-decoration: underline;
}

/* ============================================================
   MODAL
   ============================================================ */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.85);
    backdrop-filter: blur(10px);
    z-index: 10000;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
    animation: fadeIn 0.3s ease;
    overflow-y: auto;
}

.modal-overlay.hidden {
    display: none;
}

@keyframes fadeIn {
    from { opacity: 0; }
    to   { opacity: 1; }
}

.modal-container {
    background: linear-gradient(135deg, #ffffff 0%, #fff9f0 100%);
    border-radius: 24px;
    max-width: 900px;
    width: 100%;
    max-height: 90vh;
    overflow-y: auto;
    box-shadow: 0 25px 50px rgba(212, 56, 13, 0.3);
    position: relative;
    animation: slideUp 0.4s ease;
}

@keyframes slideUp {
    from { transform: translateY(50px); opacity: 0; }
    to   { transform: translateY(0);    opacity: 1; }
}

.modal-close {
    position: absolute;
    top: 20px;
    right: 20px;
    background: white;
    border: none;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    font-size: 28px;
    color: var(--primary-color);
    cursor: pointer;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
    transition: all 0.3s ease;
    z-index: 10;
}

.modal-close:hover {
    background: var(--primary-color);
    color: white;
    transform: rotate(90deg);
}

.modal-hero {
    text-align: center;
    padding: 50px 40px 30px;
    background: linear-gradient(135deg, var(--primary-color) 0%, var(--secondary-color) 100%);
    color: white;
    border-radius: 24px 24px 0 0;
    position: relative;
    overflow: hidden;
}

.modal-hero::before {
    content: '';
    position: absolute;
    top: -50%;
    right: -50%;
    width: 200%;
    height: 200%;
    background: radial-gradient(circle, rgba(255,255,255,0.1) 0%, transparent 70%);
    animation: pulse 4s ease infinite;
}

@keyframes pulse {
    0%, 100% { transform: scale(1);   opacity: 0.3; }
    50%       { transform: scale(1.1); opacity: 0.5; }
}

.modal-logo-large {
    margin-bottom: 20px;
    position: relative;
    z-index: 1;
}

.modal-logo-large img {
    width: 100px;
    height: 100px;
    background: white;
    border-radius: 50%;
    padding: 15px;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.2);
    animation: float 3s ease-in-out infinite;
}

@keyframes float {
    0%, 100% { transform: translateY(0);    }
    50%       { transform: translateY(-10px); }
}

.modal-title {
    font-size: 3rem;
    font-weight: 700;
    margin-bottom: 10px;
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.2);
    position: relative;
    z-index: 1;
}

.modal-subtitle {
    font-size: 1.3rem;
    opacity: 0.95;
    font-style: italic;
    position: relative;
    z-index: 1;
}

.modal-body {
    padding: 40px;
}

.usp-section {
    margin-bottom: 35px;
    padding: 25px;
    background: white;
    border-radius: 16px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
    transition: all 0.3s ease;
    border-left: 5px solid transparent;
}

.usp-section:hover {
    transform: translateY(-5px);
    box-shadow: 0 8px 24px rgba(212, 56, 13, 0.15);
    border-left-color: var(--primary-color);
}

.usp-icon {
    font-size: 3rem;
    margin-bottom: 15px;
    animation: bounce 2s ease infinite;
}

@keyframes bounce {
    0%, 100% { transform: translateY(0);    }
    50%       { transform: translateY(-10px); }
}

.usp-section h3 {
    color: var(--primary-color);
    font-size: 1.5rem;
    margin-bottom: 10px;
    font-weight: 600;
}

.usp-section p {
    color: var(--text-light);
    line-height: 1.8;
    font-size: 1.05rem;
}

.usp-section strong {
    color: var(--secondary-color);
    font-weight: 600;
}

.scholars-list {
    margin: 15px 0 0 20px;
    padding: 0;
}

.scholars-list li {
    margin-bottom: 8px;
    color: var(--text-light);
    line-height: 1.6;
}

.scholars-list strong {
    color: var(--primary-color);
}

.modal-footer {
    margin-top: 40px;
    padding-top: 30px;
    border-top: 2px dashed #e0e0e0;
    text-align: center;
}

.checkbox-container {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    margin-bottom: 25px;
    cursor: pointer;
    font-size: 1rem;
    color: var(--text-light);
}

.checkbox-container input[type="checkbox"] {
    width: 20px;
    height: 20px;
    cursor: pointer;
}

.modal-cta {
    background: linear-gradient(135deg, var(--primary-color) 0%, var(--secondary-color) 100%);
    color: white;
    border: none;
    padding: 18px 50px;
    font-size: 1.2rem;
    font-weight: 600;
    border-radius: 50px;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 6px 20px rgba(212, 56, 13, 0.3);
}

.modal-cta:hover {
    transform: translateY(-3px);
    box-shadow: 0 10px 30px rgba(212, 56, 13, 0.4);
}

/* ============================================================
   FOOTER
   ============================================================ */
.footer {
    background: var(--dark-bg);
    color: white;
    text-align: center;
    padding: 30px 20px;
    margin-top: 60px;
}

.footer p {
    opacity: 0.9;
}

/* ============================================================
   RESPONSIVE — TABLET (≤768px)
   ============================================================ */
@media (max-width: 768px) {

    /* Header */
    .site-title    { font-size: 2rem; }
    .site-tagline  { font-size: 1rem; }
    .site-logo     { width: 60px; height: 60px; }
    .header-content { gap: 20px; }

    /* Nav — hamburger menu */
    .nav-container {
        position: relative;
        flex-wrap: nowrap;
        padding: 10px 16px;
        padding-right: 52px; /* space for absolute hamburger */
        gap: 10px;
    }

    .nav-hamburger {
        display: block;
    }

    .nav-links {
        display: none;
        flex-direction: column;
        gap: 4px;
        position: absolute;
        top: 100%;
        left: 0;
        right: 0;
        background: white;
        box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
        padding: 10px;
        z-index: 200;
    }

    .nav-links.open {
        display: flex !important;
    }

    .nav-link {
        font-size: 1rem;
        padding: 10px 16px;
    }

    .nav-controls {
        margin-left: 0;
        gap: 8px;
    }

    .language-dropdown {
        min-width: 0;
        max-width: 140px;
        font-size: 0.9rem;
        padding: 6px 10px;
    }

    /* Thiruvalluvar card */
    .thiruvalluvar-card {
        flex-direction: column;
        text-align: center;
        padding: 30px 20px;
        gap: 20px;
    }

    .thiruvalluvar-image img  { width: 120px; height: 120px; }
    .thiruvalluvar-info h3    { font-size: 1.6rem; }
    .thiruvalluvar-stats      { justify-content: center; }

    /* Grids → single column */
    .paal-grid        { grid-template-columns: 1fr; }
    .athikarams-list  { grid-template-columns: 1fr; }

    /* Kural */
    .kural-container  { padding: 20px 16px; }
    .kural-header     { margin-bottom: 24px; }
    .kural-tamil      { font-size: 1.4rem; }
    .kural-navigation { flex-direction: column; }

    /* Filter tabs — 2-column wrap instead of full-width stack */
    .filter-tabs { flex-direction: row; flex-wrap: wrap; gap: 8px; }
    .filter-tab  { width: auto; flex: 1 1 calc(50% - 8px); text-align: center; padding: 10px 12px; font-size: 0.95rem; }

    /* Athikaram view */
    .athikaram-title-large-ta { font-size: 1.6rem; }
    .athikaram-title-large-en { font-size: 1.1rem; }
    .athikaram-navigation     { flex-direction: column; }
    .nav-button-link          { width: 100%; text-align: center; }
    .athikaram-navigation .nav-button { width: 100%; }

    /* Stats */
    .stats-grid  { grid-template-columns: repeat(3, 1fr); gap: 10px; }
    .stat-item   { padding: 14px 8px; }
    .stat-number { font-size: 1.9rem; }
    .stat-label  { font-size: 0.85rem; }
    .stat-sublabel { font-size: 0.68rem; }
    /* Contributors banner — stack on mobile */
    .contributors-banner-inner { flex-direction: column; align-items: flex-start; gap: 10px; }
    .contributors-banner-link  { width: 100%; text-align: center; justify-content: center; }
    /* Iyal grid */
    .iyal-grid { grid-template-columns: repeat(2, 1fr); }

    /* Tamil explanation translate button — original behaviour */
    /* Mobile — translate button full width below text for all 4 explanations */
    .explanation-item-compact > .explanation-translate-btn,
    .english-translate-btn {
        align-self: stretch;
        width: 100%;
        justify-content: center;
        font-size: 0.85rem;
        padding: 8px 12px;
        margin-left: 0;
    }

} /* end @media (max-width: 768px) */

/* ============================================================
   RESPONSIVE — PHONE (≤480px)
   ============================================================ */
@media (max-width: 480px) {

    /* Container & layout */
    .container    { padding: 0 12px; }
    .main-content { padding: 20px 12px; }

    /* Header */
    .header         { padding: 24px 16px; }
    .site-title     { font-size: 1.8rem; }
    .site-tagline   { font-size: 0.95rem; }
    .site-subtitle  { font-size: 0.85rem; }
    .site-logo      { width: 52px; height: 52px; }
    .header-content { gap: 12px; }

    /* Thiruvalluvar */
    .thiruvalluvar-card     { padding: 20px 16px; }
    .thiruvalluvar-info h3  { font-size: 1.4rem; }
    .thiruvalluvar-image img { width: 100px; height: 100px; }
    .stat-badge             { font-size: 0.8rem; padding: 6px 12px; }

    /* Stats — 2 columns on very small screens */
    .stats-grid  { grid-template-columns: repeat(2, 1fr); gap: 8px; }
    .stat-number { font-size: 1.7rem; }
    .stat-label  { font-size: 0.8rem; }
    .stat-sublabel { font-size: 0.65rem; }

    /* Paal cards */
    .paal-card    { padding: 20px 16px; }
    .paal-card h3 { font-size: 1.5rem; }

    /* Athikaram cards */
    .athikaram-card     { padding: 14px; }
    .athikaram-title-ta { font-size: 1.15rem; }

    /* Intro */
    .intro-section    { padding: 20px 16px; }
    .intro-section h2 { font-size: 1.5rem; }
    .intro-text       { font-size: 1rem; }

    /* Athikaram nav buttons */
    .athikaram-navigation { gap: 10px; }
    .nav-button-link      { padding: 12px 16px; font-size: 0.95rem; }

    /* Kural Tamil text — scale down so two lines fit on narrow screens */
    .kural-tamil-compact { font-size: 1.15rem; line-height: 1.5; }

    /* Modal */
    .modal-overlay  { padding: 10px; align-items: flex-start; padding-top: 20px; }
    .modal-container { margin: 0; border-radius: 16px; max-height: 92vh; }
    .modal-hero      { padding: 36px 16px 20px; }
    .modal-title     { font-size: 1.7rem; }
    .modal-logo-large img { width: 70px; height: 70px; }
    .modal-body      { padding: 16px; }
    .usp-section     { padding: 16px; }
    .modal-cta       { width: 100%; padding: 16px; font-size: 1rem; }
}


/* ── Audio / TTS Player ── */
.audio-section {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
    margin-top: 16px;
    padding: 12px 16px;
    background: linear-gradient(135deg, #fff3ee 0%, #fff9f0 100%);
    border-radius: 10px;
    border: 1.5px solid rgba(212, 56, 13, 0.2);
    flex-wrap: wrap;
}
.audio-label {
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--primary-color);
    letter-spacing: 0.03em;
    text-transform: uppercase;
}
.audio-play-btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 10px 22px;
    border: 2px solid var(--primary-color);
    background: white;
    color: var(--primary-color);
    border-radius: 50px;
    font-size: 0.95rem;
    font-weight: 700;
    cursor: pointer;
    font-family: inherit;
    transition: all 0.2s ease;
    box-shadow: 0 2px 8px rgba(212, 56, 13, 0.12);
    letter-spacing: 0.02em;
}
.audio-play-btn:hover {
    background: var(--primary-color);
    color: white;
    box-shadow: 0 4px 14px rgba(212, 56, 13, 0.3);
    transform: translateY(-1px);
}
.audio-play-btn.playing {
    background: var(--primary-color);
    color: white;
    animation: audio-pulse 1.5s ease-in-out infinite;
}
.audio-play-btn:disabled { opacity: 0.4; cursor: not-allowed; transform: none; }
@keyframes audio-pulse {
    0%   { box-shadow: 0 0 0 0 rgba(212, 56, 13, 0.5); }
    70%  { box-shadow: 0 0 0 8px rgba(212, 56, 13, 0); }
    100% { box-shadow: 0 0 0 0 rgba(212, 56, 13, 0); }
}

/* ── Audio info button ── */
.audio-info-btn {
    background: none;
    border: none;
    cursor: pointer;
    font-size: 1.15rem;
    color: var(--text-light);
    padding: 2px 4px;
    line-height: 1;
    opacity: 0.7;
    transition: opacity 0.2s;
    margin-left: 4px;
    flex-shrink: 0;
}
.audio-info-btn:hover { opacity: 1; color: var(--primary-color); }

/* ── Audio help modal ── */
.audio-help-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.6);
    backdrop-filter: blur(4px);
    z-index: 20000;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
    animation: fadeIn 0.2s ease;
}
.audio-help-overlay.hidden { display: none; }
.audio-help-box {
    background: white;
    border-radius: 14px;
    padding: 28px 30px;
    max-width: 560px;
    width: 100%;
    max-height: 85vh;
    overflow-y: auto;
    position: relative;
    box-shadow: 0 20px 60px rgba(0,0,0,0.3);
}
.audio-help-close {
    position: absolute;
    top: 14px;
    right: 18px;
    background: none;
    border: none;
    font-size: 1.6rem;
    cursor: pointer;
    color: var(--text-light);
    line-height: 1;
}
.audio-help-close:hover { color: var(--primary-color); }
.audio-help-title {
    font-size: 1.2rem;
    font-weight: 700;
    color: var(--primary-color);
    margin-bottom: 10px;
}
.audio-help-intro {
    font-size: 0.95rem;
    color: var(--text-dark);
    line-height: 1.7;
    margin-bottom: 18px;
}
.audio-help-section {
    background: #fafafa;
    border-left: 3px solid var(--secondary-color);
    border-radius: 0 8px 8px 0;
    padding: 14px 16px;
    margin-bottom: 14px;
}
.audio-help-platform {
    font-weight: 700;
    color: var(--text-dark);
    font-size: 0.97rem;
    margin-bottom: 8px;
}
.audio-help-section ol {
    margin: 0 0 0 18px;
    padding: 0;
    color: var(--text-dark);
    font-size: 0.9rem;
    line-height: 1.85;
}
.audio-help-note {
    font-size: 0.88rem;
    color: var(--text-light);
    background: #fff9f0;
    border-radius: 8px;
    padding: 12px 14px;
    margin-top: 6px;
    line-height: 1.7;
}
@media (max-width: 480px) {
    .audio-help-box { padding: 20px 16px; }
    .audio-help-title { font-size: 1.05rem; }
}

/* ── English translation section: match Tamil commentary UX ── */
.english-translation-section {
    background: #fafafa;
    padding: 15px;
    border-radius: 6px;
    border-left: 3px solid var(--primary-color);
    margin-top: 15px;
    display: flex;
    flex-direction: column;
}

.english-translation-header {
    margin-bottom: 0;
}

.english-translation-label {
    font-weight: 600;
    color: var(--primary-color);
    font-size: 0.95rem;
}

.english-translation-text {
    color: var(--text-dark);
    line-height: 1.8;
    font-size: 0.95rem;
    font-style: normal;
    margin-top: 8px;
    display: flex;
    flex-direction: column;
}

.ashraf-attribution .attribution-link {
    font-style: italic;
}

.english-attribution {
    font-size: 0.78rem;
    color: var(--text-light);
    margin-top: 4px;
}

.english-translate-btn {
    align-self: flex-end;
    margin-top: 10px;
}

