/* =============================================
   SRIVIDYALAYAM — Tablet Responsive Styles
   Landscape: 769px–1024px (any orientation)
   Portrait override: 768px–1024px, orientation:portrait
   Add via: <link rel="stylesheet" href="css/tablet.css" />
   ============================================= */

@media (min-width: 769px) and (max-width: 1024px) {

  /* ---- NAV (all pages) ---- */
  nav {
    padding: 0.5rem 1.75rem; /* Shrunk top/bottom padding to 0.5rem to make it thinner */
    height: auto !important; /* Forces the container to shrink to its new padding */
  }

  .nav-links {
    gap: 0.1rem;
  }

  .nav-links a {
    font-size: 0.68rem;
    padding: 0.35rem 0.65rem; /* Slightly reduced link padding to assist thickness */
  }

  .nav-cta {
    padding: 0.4rem 0.9rem !important; /* Slightly reduced button height */
  }

  /* ---- PAGE HERO (founder / classes / why-us) ---- */
  .page-hero {
    padding: 11rem 2rem 7rem !important;
  }


 /* =================================================
     HOMEPAGE
     ================================================= */

  .hero-portrait {
    width: 170px;
    height: 170px;
    top: 11vh;
  }

  .hero-portrait-left {
    left: 8%;
  }

  .hero-portrait-right {
    right: 8%;
  }

  /* 1. Nudges the main hero buttons down */
  .hero-btns {
    gap: 2rem;
    transform: translateY(-5px); 
  }

  /* 2. Scaled-down primary and ghost buttons */
  .hero-btns .btn-primary,
  .hero-btns .btn-ghost {
    min-width: 150px;       
    padding: 0.55rem 1.3rem; 
    font-size: 0.68rem;      
  }
  
  /* 3. Scales down the Discover More button and narrows the gap */
  .hero-discover {
    font-size: 0.68rem !important;
    padding: 0.5rem 1.2rem !important;
    min-width: 130px !important;
    margin-top: -5px !important; /* Negative margin pulls it closer to the hero buttons */
  }

  /* About section — fixed 550px image column is too
     wide at tablet size */
  .about-grid {
    grid-template-columns: 320px 1fr;
    gap: 2rem;
  }

  .about-visual {
    max-width: 320px;
  }


  /* =================================================
     FOUNDER PAGE
     ================================================= */

  .founder-grid {
    grid-template-columns: 300px 1fr;
    gap: 2.5rem;
  }

  .founder-quote-card {
    max-width: 300px;
  }

  .contact-grid {
    gap: 2.5rem;
  }


  /* =================================================
     CLASSES PAGE
     ================================================= */

  .class-info {
    padding: 2.25rem;
  }

  /* 3-column schedule is too tight at tablet width */
  .schedule-grid {
    grid-template-columns: repeat(2, 1fr);
  }

  .enrol-wrap {
    gap: 2.5rem;
  }


  /* =================================================
     WHY CHOOSE US PAGE
     ================================================= */

  /* 3-column reasons is too tight at tablet width */
  .reasons-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 1.5rem;
  }

  .reason-card {
    height: auto;
    min-height: 300px;
  }

  /* 4-column stats is too tight at tablet width */
  .stats-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 1.5rem;
  }

  .stat-item:nth-child(odd) {
    border-right: 1px solid rgba(201, 168, 76, 0.2);
  }

  .stat-item:nth-child(even) {
    border-right: none;
  }

  /* 3 testimonials side-by-side is too cramped at
     tablet width — show 2 instead */
  .testimonial-card {
    min-width: calc((100% - 2rem) / 2);
    max-width: calc((100% - 2rem) / 2);
  }
}


/* =================================================
   TABLET — PORTRAIT ORIENTATION OVERRIDE
   ================================================= 
*/

@media (min-width: 768px) and (max-width: 1024px) and (orientation: portrait) {

  /* ---- NAV ---- */
  nav {
    padding: 0 1.2rem;
  }

  .nav-links a {
    font-size: 0.66rem;
    padding: 0.5rem 0.55rem;
  }


  /* =================================================
     HOMEPAGE
     ================================================= */

  /* Slightly smaller than the landscape size below —
     portrait still has less horizontal room than the
     circles were previously taking up */

    .hero-bg{
    background-image: url("../images/hero-tablet.png") !important;
  }

  .hero-portrait {
    width: 150px;
    height: 150px;
    top: 12vh;
  }

  .hero-portrait-left {
    left: 6%;
  }

  .hero-portrait-right {
    right: 6%;
  }

  .hero-btns {
    gap: 1.5rem;
  }

    .hero-btns .btn-primary,
    .hero-btns .btn-ghost {
        min-width: 130px;
        padding: 0.55rem 1.2rem;
        font-size: 0.65rem;
    }

  /* Match the landscape two-column About layout
     instead of stacking */
  .about-grid {
    grid-template-columns: 320px 1fr;
    gap: 2rem;
  }

  .about-visual {
    max-width: 320px;
  }

  /* Performances videos — keep the 2-up grid and
     centered single video, same as landscape/desktop,
     instead of the mobile single-column stack */
  .videos-grid {
    grid-template-columns: 1fr 1fr;
  }

  .video-single .video-item {
    width: calc(50% - 0.75rem);
  }


  /* =================================================
     FOUNDER PAGE
     ================================================= */

  .founder-grid {
    grid-template-columns: 300px 1fr;
    gap: 2.5rem;
  }

  .founder-quote-card {
    max-width: 300px;
  }

  .contact-grid {
    gap: 2.5rem;
  }


  /* =================================================
     CLASSES PAGE
     ================================================= 
     Reverted — the stacked (mobile-style) class-block
     layout looked better on portrait tablets than the
     side-by-side version, so no override here; this
     lets mobile.css's stacking rules apply as before.
  */

  .class-info {
    padding: 2.25rem;
  }

  .schedule-grid {
    grid-template-columns: repeat(2, 1fr);
  }

  .enrol-wrap {
    gap: 2.5rem;
  }


  /* =================================================
     WHY CHOOSE US PAGE
     ================================================= */

  .reasons-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 1.5rem;
  }

  .reason-card {
    height: auto;
    min-height: 300px;
  }

  .stats-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 1.5rem;
  }

  .stat-item:nth-child(odd) {
    border-right: 1px solid rgba(201, 168, 76, 0.2);
  }

  .stat-item:nth-child(even) {
    border-right: none;
  }

  /* Testimonials — constrain the viewing window and
     card width tightly enough that only 2 full cards
     are ever visible, with no sliver of a 3rd peeking
     in from the side */
  .testimonial-track-wrap {
    overflow: hidden;
    width: 100%;
    flex: 1;
    min-width: 0;
  }

  .testimonial-track {
    gap: 2rem;
  }

  .testimonial-card {
    flex: 0 0 calc((100% - 2rem) / 2);
    min-width: calc((100% - 2rem) / 2);
    max-width: calc((100% - 2rem) / 2);
  }


  /* =================================================
     PRIZE WINNERS PAGE
     ================================================= */

  /* !important here as a safety net: prize-winners.css
     has its own breakpoints, and if tablet.css happens
     to be linked before it in the HTML <head>, that
     file's rules would otherwise win the cascade tie.
     Double-check tablet.css is linked AFTER
     css/prize-winners.css in every page's <head> so
     load order doesn't cause this same problem
     elsewhere. */
  .winners-masonry {
    column-count: 2 !important;
    column-gap: 1.5rem !important;
  }
}

/* =================================================
   COMPACT PORTRAIT TABLETS
   600px–900px wide
   Targets 768px iPad / iPad Mini-sized portrait
   screens without changing the larger 1024px tablet
   rules above.
   ================================================= */

@media (min-width: 600px) and (max-width: 1024px) and (orientation: portrait) {

  /* ---- HAMBURGER NAV ----
     Keep the dropdown full-width, but align its contents
     consistently and make Enrol Now content-sized rather
     than stretching across the menu. */
  nav {
    padding-left: 1.2rem;
    padding-right: 1.2rem;
  }

  .nav-links {
    left: 0;
    right: 0;
    width: 100%;
    align-items: flex-start;
  }

  .nav-links li {
    width: 100%;
  }

  .nav-links a {
    display: block;
    width: 100%;
    padding-left: 2rem;
    padding-right: 2rem;
  }

  .nav-links .nav-cta {
    display: inline-block !important;
    width: auto !important;
    max-width: max-content;
    margin: 0.5rem 0 0 2rem !important;
    padding: 0.65rem 1.2rem !important;
    text-align: center !important;
    white-space: nowrap;
  }


  /* ---- HOMEPAGE HERO ----
     Move the CTA row slightly lower on compact portrait
     tablets. Positive translateY replaces the previous
     tablet rule's upward nudge. */
  .hero-btns {
    gap: 1.5rem;
    transform: translateY(18px);
  }

  .hero-btns .btn-primary,
  .hero-btns .btn-ghost {
    min-width: 130px;
    width: auto;
    padding: 0.55rem 1.2rem;
    font-size: 0.65rem;
  }

  .hero-btns .btn-primary {
    margin-left: 0 !important;
  }

  .hero-discover {
    margin-top: 1.5rem !important;
  }
}


/* =================================================
   VERY COMPACT PORTRAIT TABLETS
   600px–767px
   Keeps iPad Mini-sized screens from inheriting
   phone-sized hero buttons/layout where possible.
   ================================================= */

@media (min-width: 600px) and (max-width: 1024px) and (orientation: portrait) {

  .nav-links a {
    padding-left: 1.75rem;
    padding-right: 1.75rem;
  }

  .nav-links .nav-cta {
    margin-left: 1.75rem !important;
  }

  .hero-content {
    padding-left: 3vw;
    padding-right: 3vw;
  }

  .hero-btns {
    flex-direction: row;
    flex-wrap: wrap;
    gap: 1.25rem;
    width: 100%;
    transform: translateY(16px);
  }

  .hero-btns .btn-primary,
  .hero-btns .btn-ghost {
    width: auto;
    min-width: 125px;
    max-width: none;
    padding: 0.55rem 1rem;
    font-size: 0.64rem;
  }

     .hero-portrait-left {
    left: 10%; /* Nudges it inward on narrow portrait screens */
  }

  .hero-portrait-right {
    right: 10%; /* Nudges it inward on narrow portrait screens */
  }
}

/* =========================================================
   SRIVIDYALAYAM — Melakarta wheel
   Learn page (learn.html)
   ========================================================= */


/* =========================================================
   MELAKARTA SECTION
   ========================================================= */

#melakarta {
    position: relative;
    background:
        radial-gradient(ellipse at 28% 55%, #3a0014 0%, rgba(26, 0, 8, 0) 60%),
        var(--crimson-deep);
    padding: 6rem 2rem;
    overflow: hidden;
    color: var(--gold-pale);
}

#melakarta .section-inner {
    max-width: 1200px;
}

#melakarta .section-badge {
    color: var(--gold);
}

#melakarta .section-title {
    color: var(--cream);
}

#melakarta .section-title em {
    color: var(--gold-light);
}

.mela-intro {
    max-width: 680px;
    font-size: 0.97rem;
    line-height: 1.85;
    color: rgba(245, 233, 200, 0.7);
    margin-bottom: 3rem;
}

.mela-layout {
    display: grid;
    grid-template-columns: minmax(0, 1.15fr) minmax(0, 1fr);
    gap: clamp(2rem, 4vw, 4rem);
    align-items: center;
}


/* ---------- Buttons ---------- */

.mela-btn {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;

    background: transparent;
    color: rgba(201, 168, 76, 0.95);
    border: 1px solid rgba(201, 168, 76, 0.6);

    padding: 0.6rem 1.3rem;

    font-family: 'Raleway', sans-serif;
    font-size: 0.7rem;
    font-weight: 700;
    letter-spacing: 0.15em;
    text-transform: uppercase;

    cursor: pointer;
    transition: border-color 0.3s ease, color 0.3s ease, background 0.3s ease, transform 0.3s ease;
}

.mela-btn i {
    font-size: 1rem;
}

.mela-btn:hover {
    border-color: var(--gold-light);
    color: var(--gold-light);
    transform: translateY(-2px);
}

.mela-btn:focus-visible {
    outline: 2px solid var(--gold-light);
    outline-offset: 3px;
}

/* ---------- Wheel ---------- */

.mela-wheel {
    width: 100%;
    max-width: 580px;
    margin: 0 auto;
}

.mela-svg {
    display: block;
    width: 100%;
    height: auto;
    overflow: visible;
    user-select: none;
    -webkit-user-select: none;
}

.mela-rim {
    fill: none;
    stroke: rgba(201, 168, 76, 0.35);
    stroke-width: 1;
}

.mela-seg path {
    fill: rgba(201, 168, 76, 0.04);
    stroke: rgba(201, 168, 76, 0.28);
    stroke-width: 0.6;
    cursor: pointer;
    transition: fill 0.35s ease;
}

.mela-seg:nth-child(even) path {
    fill: rgba(201, 168, 76, 0.08);
}

.mela-seg:hover path {
    fill: rgba(201, 168, 76, 0.22);
}

.mela-seg-label {
    font-family: 'Cormorant Garamond', serif;
    font-size: 9.5px;
    font-weight: 600;
    fill: rgba(245, 233, 200, 0.78);
    pointer-events: none;
    transition: fill 0.35s ease;
}

.mela-seg-label.compact {
    font-family: 'Raleway', sans-serif;
    font-size: 11px;
    font-weight: 600;
}

.mela-seg.is-today .mela-seg-label {
    fill: var(--gold-light);
}

.mela-seg.is-active path {
    fill: var(--gold);
    stroke: var(--gold-light);
}

.mela-seg.is-active .mela-seg-label {
    fill: var(--crimson-deep);
    font-weight: 700;
}

.mela-chakra-seg path {
    fill: rgba(107, 0, 32, 0.55);
    stroke: rgba(201, 168, 76, 0.35);
    stroke-width: 0.8;
    transition: fill 0.4s ease;
}

.mela-chakra-seg.alt path {
    fill: rgba(133, 0, 42, 0.45);
}

.mela-chakra-seg.is-active path {
    fill: rgba(201, 168, 76, 0.28);
}

.mela-chakra-label {
    font-family: 'Raleway', sans-serif;
    font-size: 9.5px;
    font-weight: 700;
    letter-spacing: 0.2em;
    fill: rgba(226, 194, 114, 0.85);
    pointer-events: none;
}

.mela-divider {
    stroke: var(--gold);
    stroke-width: 1.6;
}

.mela-today-mark circle {
    fill: var(--gold-light);
    stroke: var(--crimson-deep);
    stroke-width: 1.5;
}

.mela-pointer {
    fill: var(--gold-light);
    filter: drop-shadow(0 0 6px rgba(226, 194, 114, 0.6));
}

.mela-core-disc {
    stroke: rgba(201, 168, 76, 0.55);
    stroke-width: 1.2;
}

.mela-core-guide {
    fill: none;
    stroke: rgba(201, 168, 76, 0.18);
    stroke-width: 1;
    stroke-dasharray: 2 4;
}

.mela-shape {
    fill: rgba(201, 168, 76, 0.13);
    stroke: rgba(226, 194, 114, 0.75);
    stroke-width: 1.3;
    stroke-linejoin: round;
}

.mela-note {
    fill: rgba(201, 168, 76, 0.22);
    transition: r 0.3s ease, fill 0.3s ease;
}

.mela-note.on {
    fill: var(--gold);
    r: 5.5px;
}

.mela-note.sounding {
    fill: var(--gold-pale);
    r: 8px;
    filter: drop-shadow(0 0 6px rgba(245, 233, 200, 0.9));
}

.mela-note-label {
    font-family: 'Raleway', sans-serif;
    font-size: 8.5px;
    font-weight: 600;
    fill: rgba(245, 233, 200, 0.3);
    transition: fill 0.3s ease;
}

.mela-note-label.on {
    fill: rgba(245, 233, 200, 0.9);
}

.mela-core-num {
    font-family: 'Cormorant Garamond', serif;
    font-size: 44px;
    font-weight: 600;
    fill: var(--gold-light);
}

.mela-core-sub {
    font-family: 'Raleway', sans-serif;
    font-size: 8.5px;
    font-weight: 700;
    letter-spacing: 0.25em;
    fill: rgba(245, 233, 200, 0.6);
}


/* ---------- Panel ---------- */

.mela-panel {
    position: relative;
    padding: 2.4rem 2.2rem;
    border: 1px solid rgba(201, 168, 76, 0.35);
    background: linear-gradient(135deg, rgba(107, 0, 32, 0.35), rgba(26, 0, 8, 0.2));
}

.mela-panel::before {
    content: "";
    position: absolute;
    inset: 10px;
    border: 1px solid rgba(201, 168, 76, 0.15);
    pointer-events: none;
}

.mela-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 0.3rem 1rem;
    font-size: 0.68rem;
    font-weight: 700;
    letter-spacing: 0.2em;
    text-transform: uppercase;
}

.mela-num {
    color: var(--gold);
}

.mela-chakra {
    color: rgba(245, 233, 200, 0.55);
}

.mela-name {
    font-family: 'Cormorant Garamond', serif;
    font-size: clamp(1.8rem, 3.2vw, 2.6rem);
    font-weight: 600;
    font-style: italic;
    color: var(--gold-pale);
    line-height: 1.1;
    margin: 0.5rem 0 0.4rem;
    overflow-wrap: anywhere;
}

.mela-today-tag {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    font-size: 0.66rem;
    font-weight: 700;
    letter-spacing: 0.18em;
    text-transform: uppercase;
    color: var(--crimson-deep);
    background: var(--gold-light);
    padding: 0.25rem 0.6rem;
    margin-bottom: 0.4rem;
}

.mela-today-tag[hidden] {
    display: none;
}

.mela-scale-label {
    font-size: 0.66rem;
    font-weight: 700;
    letter-spacing: 0.2em;
    text-transform: uppercase;
    color: rgba(245, 233, 200, 0.5);
    margin: 1.3rem 0 0.55rem;
}

.mela-swaras {
    display: flex;
    flex-wrap: wrap;
    gap: 0.4rem;
}

.swara-chip {
    display: inline-flex;
    align-items: baseline;
    justify-content: center;
    min-width: 2.5rem;
    height: 2.5rem;
    padding: 0 0.35rem;
    align-items: center;

    font-family: 'Cormorant Garamond', serif;
    font-size: 1.3rem;
    font-weight: 600;
    color: var(--gold-pale);

    border: 1px solid rgba(201, 168, 76, 0.35);
    background: rgba(26, 0, 8, 0.4);

    transition: background 0.25s ease, color 0.25s ease, transform 0.25s ease, box-shadow 0.25s ease;
}

.swara-chip sub {
    font-size: 0.7rem;
    font-family: 'Raleway', sans-serif;
    font-weight: 700;
    margin-left: 1px;
    align-self: flex-end;
    margin-bottom: 0.45rem;
}

.swara-letter {
    position: relative;
}

.tara-dot {
    position: absolute;
    top: -0.12rem;
    left: 50%;
    width: 4px;
    height: 4px;
    margin-left: -2px;
    border-radius: 50%;
    background: currentColor;
}

.swara-chip.is-on {
    background: var(--gold);
    color: var(--crimson-deep);
    border-color: var(--gold-light);
    transform: translateY(-3px);
    box-shadow: 0 6px 18px rgba(201, 168, 76, 0.35);
}

.mela-notes {
    list-style: none;
    margin-top: 1.4rem;
    padding-top: 1.1rem;
    border-top: 1px solid rgba(201, 168, 76, 0.2);
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 0.45rem 1rem;
}

.mela-notes li {
    font-size: 0.82rem;
    color: rgba(245, 233, 200, 0.7);
    display: flex;
    align-items: baseline;
    gap: 0.5rem;
}

.note-key {
    font-family: 'Cormorant Garamond', serif;
    font-size: 1.05rem;
    font-weight: 700;
    color: var(--gold);
    min-width: 1.6rem;
}

.note-key sub {
    font-size: 0.62rem;
}

/* Two rows by default:  [‹] [Hear the Scale] [›]  /  [Today]
   One row when the panel is wide enough (container query below). */
.mela-panel {
    container-type: inline-size;
}

.mela-controls {
    display: grid;
    grid-template-columns: auto minmax(0, 1fr) auto;
    align-items: stretch;
    gap: 0.6rem;
    margin-top: 1.8rem;
}

.mela-controls .mela-btn {
    justify-content: center;
    white-space: nowrap;
}

.mela-prev      { grid-column: 1; grid-row: 1; }
.mela-play      { grid-column: 2; grid-row: 1; }
.mela-next      { grid-column: 3; grid-row: 1; }
.mela-today-btn { grid-column: 1 / -1; grid-row: 2; }

@container (min-width: 560px) {
    .mela-controls {
        grid-template-columns: auto minmax(0, 1fr) auto auto;
    }

    .mela-today-btn { grid-column: 3; grid-row: 1; }
    .mela-next      { grid-column: 4; grid-row: 1; }
}

.mela-btn.solid {
    background: var(--gold);
    color: var(--crimson-deep);
    border-color: var(--gold);
}

.mela-btn.solid:hover {
    background: var(--gold-light);
    color: var(--crimson-deep);
}

.mela-btn.icon-only {
    padding: 0.6rem 0.7rem;
}


/* =========================================================
   RESPONSIVE
   ========================================================= */

@media (max-width: 900px) {
    .mela-layout {
        grid-template-columns: minmax(0, 1fr);
    }

    .mela-wheel {
        max-width: 520px;
    }
}

@media (max-width: 768px) {
    #melakarta {
        padding: 4rem 1.5rem;
    }

    .mela-intro {
        margin-bottom: 2rem;
    }

    .mela-panel {
        padding: 1.8rem 1.4rem;
    }

    /* mobile.css shrinks every h3 to 1.1rem; keep the raga name prominent */
    #melakarta h3.mela-name {
        font-size: 1.75rem !important;
    }
}

@media (max-width: 480px) {
    /* keep all 8 swaras on one line */
    .mela-swaras {
        display: grid;
        grid-template-columns: repeat(8, minmax(0, 1fr));
        gap: 0.25rem;
    }

    .swara-chip {
        min-width: 0;
        height: 2.2rem;
        padding: 0;
        font-size: 1.05rem;
    }

    .swara-chip sub {
        font-size: 0.6rem;
        margin-bottom: 0.35rem;
    }

    #melakarta h3.mela-name {
        font-size: 1.5rem !important;
    }

    .mela-notes {
        grid-template-columns: minmax(0, 1fr);
    }
}

@media (prefers-reduced-motion: reduce) {
    .swara-chip,
    .mela-note,
    .mela-seg path,
    .mela-btn {
        transition: none;
    }
}
