/* Alphabet learning workspace. Logo and shared navigation are unchanged. */
.alphabet-page { background: #fff; color: #252525; }
.alphabet-page p { text-align: left; hyphens: none; font-size: 1.05rem; line-height: 1.75; }
.alphabet-page .container { max-width: 1240px; padding: 0 28px; }
.alphabet-page .page-hero-banner { background: #a10000; color: #fff; align-items: center; text-align: center; min-height: auto; width: 100%; padding: 24px; margin: 0; box-shadow: none; }
.alphabet-page .page-hero-banner h1 { color: #fff; font: 700 clamp(2rem, 4vw, 2.7rem)/1.2 Georgia, 'Latha', serif; text-shadow: none; }
.alphabet-page .page-hero-banner p { color: #fff; text-align: center; font-size: 1.1rem; font-weight: 400; margin: 8px 0 0; }
.alphabet-page .alphabet-intro { margin: 32px auto 24px; }
.alphabet-page .alphabet-intro p { margin: 0; color: #4e4e4e; }
.alphabet-page .alphabet-summary { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); margin: 0 auto 32px; }
.alphabet-summary a { display: flex; flex-direction: column; align-items: center; text-align: center; justify-content: center; background: #faf7f7; color: #242424; text-decoration: none; padding: 18px 12px; position: relative; }
.alphabet-summary a:first-child { border-radius: 14px 0 0 14px; }
.alphabet-summary a:last-child { border-radius: 0 14px 14px 0; }
.alphabet-summary a + a::before { content: ''; position: absolute; left: 0; top: 20%; height: 60%; border-left: 1px solid #dfb7b7; }
.alphabet-summary strong { font: 700 2.7rem/1.15 Georgia, serif; color: #a10000; }
.alphabet-summary span { font-size: 1rem; line-height: 1.7; }
.alphabet-summary span:first-of-type { font-weight: 700; }
.alphabet-page .alphabet-layout { display: grid; grid-template-columns: 250px minmax(0, 1fr); gap: 30px; align-items: start; }
.alphabet-sidebar { position: static; border: 1px solid #ded8d8; border-radius: 12px; overflow: hidden; }
.alphabet-sidebar nav { padding-bottom: 10px; }
.alphabet-page .alphabet-sidebar h2 { margin: 0 0 10px; padding: 14px 18px; font-size: 1.3rem; background: #a10000; color: #fff; border: 0; }
.alphabet-sidebar a { display: block; padding: 11px 14px; margin: 0 8px; border-left: 3px solid transparent; border-radius: 5px; color: #343434; font-size: 1rem; line-height: 1.45; text-decoration: none; }
.alphabet-sidebar a:hover, .alphabet-sidebar a[aria-current="location"] { background: #fbefef; border-left-color: #a10000; color: #a10000; }
.alphabet-content { min-width: 0; }
.alphabet-page .alphabet-content > section { margin-bottom: 34px; scroll-margin-top: 110px; }
.alphabet-page .alphabet-content h2 { font-family: Georgia, 'Latha', serif; border: 0; border-left: 6px solid #a10000; padding: 0 0 0 14px; margin: 0 0 16px; font-size: clamp(1.45rem, 2.4vw, 1.9rem); line-height: 1.4; color: #222; }
.alphabet-page .alphabet-content h3 { font-size: 1.15rem; margin: 24px 0 14px; }
.alphabet-page .alphabet-content ul { padding-left: 22px; font-size: 1.05rem; }
.alphabet-page .alphabet-grid { grid-template-columns: repeat(6, minmax(0, 1fr)); gap: 10px; }
.alphabet-page #consonants .alphabet-grid { grid-template-columns: repeat(9, minmax(0, 1fr)); }
.alphabet-page .alphabet-grid.single { grid-template-columns: 1fr; margin: 16px 0; }
.alphabet-page .letter-card { position: relative; min-width: 0; min-height: 72px; padding: 12px 6px; border: 1px solid #dedcdc; border-radius: 10px; background: linear-gradient(#fff, #fdfbfb); box-shadow: 0 1px 2px #00000006; font-size: 2rem; }
.alphabet-page .letter-card small { font-size: .875rem; line-height: 1.4; }
.alphabet-page .letter-card:hover { transform: none; border-color: #a10000; box-shadow: 0 0 0 1px #a1000015; }
.alphabet-page .letter-card[aria-pressed="true"] { border-color: #a10000; background: #fcf0ef; }
.alphabet-page .letter-card[aria-pressed="true"] span { color: #a10000; }
.alphabet-page .letter-card[role="button"] { cursor: pointer; }
.alphabet-page .letter-card:focus-visible::after { opacity: 1; visibility: visible; }
.alphabet-page .letter-detail { display: flex; gap: 26px; align-items: center; padding: 20px 24px; margin: 18px 0 0; background: #fcf9f9; border: 1px solid #e5dcdc; border-radius: 12px; }
.letter-detail-symbol { font-size: 3.5rem; line-height: 1.5; color: #a10000; border-right: 1px solid #d2adad; padding-right: 26px; }
.alphabet-page .letter-detail p { margin: 0; }
.alphabet-page .letter-detail strong { color: #a10000; font-size: 1.2rem; }
.compound-controls { display: flex; flex-wrap: wrap; gap: 6px; margin: 16px 0; }
.compound-controls button { font-family: var(--tamil-font); font-size: 1.1rem; min-width: 40px; min-height: 44px; padding: 7px; border-radius: 7px; border: 1px solid #dedcdc; background: #fff; color: #333; cursor: pointer; }
.compound-controls button[aria-pressed="true"] { background: #a10000; border-color: #a10000; color: #fff; }
.alphabet-page .chart-toggle { display: block; width: 100%; min-height: 48px; padding: 12px 16px; margin: 20px 0; border: 1px solid #e1d9d9; border-radius: 8px; background: #faf5f5; color: #a10000; font: 700 1rem/1.5 var(--english-font); text-align: right; cursor: pointer; }
.alphabet-page [hidden] { display: none !important; }
.alphabet-page .modern-info-container { grid-template-columns: repeat(auto-fit, minmax(min(100%, 230px), 1fr)); gap: 16px; }
.alphabet-page .info-card { border: 1px solid #e2dcdc; border-radius: 12px; box-shadow: none; padding: 22px; }
.alphabet-page .info-card:hover { transform: none; box-shadow: none; }
.alphabet-page .info-card h4 { font-size: 1.4rem; }
.alphabet-page .info-card p { font-size: 1rem; }
.alphabet-page .formula-card { font-size: 1.25rem; flex-wrap: wrap; overflow-wrap: anywhere; background: #faf7f7; }
.alphabet-page #writing-practice, .alphabet-page #interactive-quiz { text-align: left; background: #fff; border: 1px solid #e2dcdc; padding: 24px; border-radius: 12px; }
.alphabet-page .cta-button { background: #a10000; border-radius: 8px; font-family: inherit; }
.alphabet-page .cta-button:hover { background: #780000; box-shadow: none; transform: none; }
.alphabet-page #quiz-container { max-width: none; margin: 0; }
.alphabet-page #question-card { margin-left: 0; border: 1px solid #e2dcdc; box-shadow: none; color: #a10000; }
.alphabet-page #options-container { grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 10px; }
.alphabet-page .option-btn { color: #a10000; border-color: #d8baba; }
.alphabet-page .option-btn:hover:not(:disabled) { background: #fbefef; color: #a10000; }
.alphabet-page .option-btn.correct { color: #fff; border-color: #238148; background: #238148; }
.alphabet-page .option-btn.wrong { color: #fff; border-color: #b42222; background: #b42222; }
.alphabet-page :is(a, button, [role="button"]):focus-visible { outline: 3px solid #a10000; outline-offset: 4px; }
.alphabet-section-select, .compound-series-select, .mobile-letter-focus, .alphabet-page .mobile-grammar-action { display: none; }
@media (max-width: 1000px) {
  .alphabet-page .alphabet-layout { grid-template-columns: 210px minmax(0, 1fr); gap: 22px; }
  .alphabet-page #consonants .alphabet-grid { grid-template-columns: repeat(6, minmax(0, 1fr)); }
}
@media (max-width: 760px) {
  .alphabet-page .container { max-width: 100%; padding-left: 20px; padding-right: 20px; }
  .alphabet-page .page-hero-banner { padding: 24px 20px; }
  .alphabet-page .alphabet-summary { grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 0; margin-bottom: 24px; }
  .alphabet-summary a { padding: 14px 5px; justify-content: flex-start; min-width: 0; }
  .alphabet-summary a + a::before { top: 12%; height: 76%; }
  .alphabet-summary strong { font-size: clamp(1.8rem, 5.5vw, 2.6rem); }
  .alphabet-summary span { font-size: .875rem; line-height: 1.45; overflow-wrap: anywhere; }
  .alphabet-summary span:first-of-type { margin: 5px 0; }
  .alphabet-page .alphabet-layout { display: block; }
  .alphabet-sidebar { position: static; margin-bottom: 28px; border: 0; overflow: visible; }
  .alphabet-sidebar.has-section-picker nav { display: none; }
  .alphabet-section-select { display: block; width: 100%; min-height: 48px; padding: 10px 40px 10px 16px; color: #292929; background: #fff; border: 1px solid #d3cdcd; border-radius: 8px; font: 1rem/1.5 var(--english-font); }
  .alphabet-section-select:focus-visible, .compound-series-select:focus-visible { outline: 3px solid #a10000; outline-offset: 3px; }
  .alphabet-sidebar nav { max-height: none; display: flex; flex-wrap: wrap; gap: 4px; padding: 10px; }
  .alphabet-page .alphabet-sidebar h2 { width: 100%; border-radius: 6px; margin-bottom: 4px; }
  .alphabet-sidebar a { margin: 0; font-size: .9rem; padding: 10px; }
  .alphabet-content { display: flex; flex-direction: column; }
  .alphabet-content > section { order: 8; }
  .alphabet-content #vowels { order: 1; }
  .alphabet-content #consonants { order: 2; }
  .alphabet-content #compound-letters { order: 3; }
  .alphabet-content #letter-in-focus { order: 4; }
  .alphabet-content #confused-letters { order: 5; }
  .alphabet-content #alphabet-overview { order: 6; }
  .alphabet-content #writing-practice { order: 10; }
  .alphabet-content #interactive-quiz { order: 11; }
  .alphabet-page .alphabet-content h2 { font-size: clamp(1.25rem, 3.7vw, 1.8rem); padding-left: 12px; border-left-width: 5px; }
  .alphabet-page .alphabet-grid, .alphabet-page #consonants .alphabet-grid { grid-template-columns: repeat(6, minmax(0, 1fr)); gap: 8px; }
  .alphabet-page .letter-card, .alphabet-page #consonants .letter-card { font-size: clamp(1.1rem, 4vw, 2rem); padding: 10px 2px; min-height: 52px; border-radius: 8px; }
  .alphabet-page #alphabet-overview .alphabet-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .alphabet-page #consonants .letter-card small { font-size: .875rem; }
  .compound-controls { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)) minmax(0, 1fr); gap: 7px; }
  .compound-controls button { min-width: 0; font-size: 1.1rem; padding: 7px 2px; }
  .compound-controls button:nth-of-type(n+6) { display: none; }
  .compound-series-select { display: block; width: 100%; min-width: 0; min-height: 44px; padding: 4px; background: #fff; border: 1px solid #dedcdc; border-radius: 7px; color: #a10000; font: 1rem var(--tamil-font); }
  .alphabet-page #compound-letters > h3 { margin: 18px 0 0; padding: 16px 14px 10px; background: #fbf2f2; border-radius: 10px 10px 0 0; }
  .alphabet-page #compound-letters > .alphabet-grid { padding: 0 12px 16px; background: #fbf2f2; border-radius: 0 0 10px 10px; gap: 6px; }
  .alphabet-page #compound-letters .letter-card { font-size: clamp(1rem, 3.6vw, 1.7rem); min-height: 46px; }
  .mobile-letter-focus { display: block; }
  .focus-card { border: 1px solid #e2dcdc; border-radius: 12px; padding: 16px; }
  .focus-intro { display: grid; grid-template-columns: minmax(60px, 100px) minmax(0, 1fr); gap: 18px; align-items: start; }
  .focus-symbol { display: grid; place-items: center; background: #a10000; color: #fff; min-height: 100px; border-radius: 8px; font: 3.5rem/1.5 var(--tamil-font); }
  .alphabet-page .focus-intro h3 { color: #a10000; font-size: 1.45rem; margin: 0 0 6px; }
  .alphabet-page .focus-intro p { font-size: 1rem; margin: 0 0 8px; line-height: 1.5; }
  .focus-card table { width: 100%; border-collapse: collapse; margin-top: 12px; font-size: .95rem; }
  .focus-card caption { color: #a10000; font-weight: 700; text-align: left; border-top: 1px solid #eddada; padding: 8px 0; }
  .focus-card th, .focus-card td { text-align: left; padding: 6px 4px; border-bottom: 1px solid #eee; overflow-wrap: anywhere; }
  .focus-card th { font-size: .875rem; }
  .alphabet-page #confused-letters .modern-info-container { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; }
  .alphabet-page #confused-letters .info-card { padding: 14px 10px; }
  .alphabet-page #confused-letters .info-card h4 { font-size: clamp(1.1rem, 3.5vw, 1.8rem); text-align: center; }
  .alphabet-page #confused-letters .info-card p, .alphabet-page #confused-letters .info-card code { font-size: .95rem; overflow-wrap: anywhere; }
  .alphabet-page #writing-practice, .alphabet-page #interactive-quiz { background: #fcf5f5; border: 0; padding: 22px; }
  .alphabet-page .mobile-grammar-action { display: block; order: 12; text-align: center; margin: 0 0 32px; }
  .alphabet-page .letter-detail { gap: 16px; padding: 16px; }
  .letter-detail-symbol { font-size: 2.6rem; padding-right: 16px; }
  .alphabet-page #options-container { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (min-width: 600px) and (max-width: 760px) {
  .compound-controls { grid-template-columns: repeat(10, minmax(0, 1fr)); }
  .compound-controls button:nth-of-type(n+6) { display: block; }
  .compound-controls button:nth-of-type(n+10) { display: none; }
}
@media (max-width: 380px) {
  .alphabet-page #confused-letters .modern-info-container { grid-template-columns: 1fr; }
  .focus-intro { grid-template-columns: 60px minmax(0, 1fr); gap: 12px; }
  .focus-symbol { min-height: 72px; font-size: 2.5rem; }
}
@media (prefers-reduced-motion: reduce) { .alphabet-page .letter-card, .alphabet-page .letter-card::after { transition: none; } }
