/* Open to All Teaching — page styles */

/*==================================================================
  Course cards — course-title-first anatomy:
  [ title (grows) ] -> [ avatar + faculty name ] -> [ view details ]
  Cards in one row share equal height (shared .card { height:100% }),
  and the flex-grow title block pins every faculty row + button to
  the bottom edge so rows always align.
==================================================================*/
.ota-card {
    display: flex;
    flex-direction: column;
}
.ota-card .card-body {
    flex: 1 1 auto;
    padding: 20px 20px 10px;
}
.ota-card .card-body .card-title {
    font-family: var(--font-head);
    color: var(--iith-indigo);
    font-size: 1.06rem;
    line-height: 1.35;
    margin: 0;
}
.ota-card__faculty {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 20px 0;
    border-top: 1px dashed var(--line);
    margin: 0 0 12px;
}
.ota-card__avatar {
    flex-shrink: 0;
    width: 52px;
    height: 52px;
    border-radius: 50%;
    object-fit: cover;
    object-position: center top;
    border: 2px solid var(--line);
    box-shadow: var(--shadow-sm);
    background: var(--bg-alt);
}
.ota-card__by {
    margin: 0;
    color: var(--muted);
    font-family: var(--font-body);
    font-size: .88rem;
    line-height: 1.4;
}
.ota-card__btn {
    margin: 0 20px 18px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: .5rem 1rem;
    font-size: .9rem;
}
@media (max-width: 575.98px) {
    .ota-card .card-body { padding: 16px 16px 8px; }
    .ota-card__faculty { padding: 10px 16px 0; }
    .ota-card__btn { margin: 0 16px 16px; }
}

/* Intro video: full width on phones (fluid sizing comes from the shared
   iframe[width][src*="youtube.com/embed"] rule in style.css); on md+ keep
   the original offset-md-3 placement inside the right-hand column */
.intro-video { display: flex; justify-content: center; }
@media (min-width: 768px) {
    .intro-video { justify-content: flex-start; margin-left: 25%; }
}

/* Course cards: vertical breathing room when cards wrap/stack
   (the rows have no gutter-y, so stacked cards would touch) */
.gallery_product { margin-bottom: 1.5rem; }

/* Section headings (Registration Fee / Certificate / Important Points):
   same sunrise-rule treatment as .info-card headings */
.row > .col-12 > h2 {
    font-size: 1.5rem;
    line-height: 1.2;
    position: relative;
    padding-left: 16px;
    margin-bottom: .5rem;
}
.row > .col-12 > h2::before {
    content: "";
    position: absolute;
    left: 0; top: .1em; bottom: .1em;
    width: 4px;
    border-radius: 3px;
    background: var(--sunrise-bar);
}

/*==================================================================
  Semester browser — the .semester-toggle buttons and their collapse
  panels share one container (.semester-browser). The grid lays the
  toggle cards out responsively; each collapse panel spans the full
  row beneath the group.
==================================================================*/
.semester-browser {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(min(260px, 100%), 1fr));
    gap: 12px;
}
.semester-browser > .collapse,
.semester-browser > .collapsing {
    grid-column: 1 / -1;
}

/* Toggle buttons: quiet surface cards instead of solid primary pills */
.btn.semester-toggle {
    margin: 0 !important; /* replaces .m-2 — the grid gap spaces the cards */
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    text-align: left;
    min-height: 52px; /* comfortable tap target */
    padding: 12px 18px;
    position: relative;
    overflow: hidden;
    background-color: var(--surface);
    border: 1px solid var(--line);
    border-radius: var(--radius);
    box-shadow: var(--shadow-sm);
    color: var(--iith-indigo);
    font-family: var(--font-head);
    font-size: .98rem;
    font-weight: 600;
    line-height: 1.35;
}
.btn.semester-toggle:hover,
.btn.semester-toggle:focus,
.btn.semester-toggle:active {
    background-color: var(--surface);
    border-color: rgba(214, 67, 28, .35);
    color: var(--iith-vermillion);
    box-shadow: var(--shadow-md);
    transform: translateY(-2px);
}

/* Sunrise accent bar along the left edge — revealed on the open card */
.btn.semester-toggle::before {
    content: "";
    position: absolute;
    left: 0; top: 0; bottom: 0;
    width: 4px;
    background: var(--sunrise-bar);
    opacity: var(--toggle-open, 0);
    transition: opacity .2s ease;
}

/* Chevron indicator — rotates to point up while the panel is open */
.btn.semester-toggle::after {
    content: "";
    flex: 0 0 auto;
    width: 9px;
    height: 9px;
    border-right: 2px solid currentColor;
    border-bottom: 2px solid currentColor;
    border-radius: 1px;
    transform: rotate(calc(45deg + var(--toggle-open, 0) * 180deg));
    transition: transform .25s ease;
}

/* Open state: keyed on the actual state of each button's target panel
   (the page toggles .show directly, so aria/collapsed can go stale).
   Progressive enhancement — without :has() the cards just stay quiet. */
.semester-toggle[data-bs-target="#collapseJul2026"]:has(~ #collapseJul2026:is(.show, .collapsing)),
.semester-toggle[data-bs-target="#collapsejan2026"]:has(~ #collapsejan2026:is(.show, .collapsing)),
.semester-toggle[data-bs-target="#collapseJul2025"]:has(~ #collapseJul2025:is(.show, .collapsing)),
.semester-toggle[data-bs-target="#collapseJan2025"]:has(~ #collapseJan2025:is(.show, .collapsing)),
.semester-toggle[data-bs-target="#collapseJuly2024"]:has(~ #collapseJuly2024:is(.show, .collapsing)),
.semester-toggle[data-bs-target="#collapseJanuary"]:has(~ #collapseJanuary:is(.show, .collapsing)),
.semester-toggle[data-bs-target="#collapseFebruary"]:has(~ #collapseFebruary:is(.show, .collapsing)) {
    --toggle-open: 1;
    border-color: rgba(214, 67, 28, .45);
    color: var(--iith-vermillion);
    box-shadow: var(--shadow-md);
}

/* The collapse panel is itself a .card; it should not lift or show a
   pointer cursor like the course cards inside it do */
.semester-browser .card.card-body:hover {
    cursor: default;
    transform: none;
    box-shadow: var(--shadow-sm);
}

/* Panel headings ("Courses (…) Semester") — match the sunrise rule */
.semester-browser .card.card-body h3 {
    font-size: 1.3rem;
    line-height: 1.2;
    position: relative;
    padding-left: 16px;
    margin-bottom: 1.1rem;
}
.semester-browser .card.card-body h3::before {
    content: "";
    position: absolute;
    left: 0; top: .12em; bottom: .12em;
    width: 4px;
    border-radius: 3px;
    background: var(--sunrise-bar);
}

/* The shared .card-body rule reserves 4.5rem/6.5rem of padding for an
   absolutely-positioned .card-btn; the collapse panels are in normal flow,
   so reclaim that dead space on phones and tablets (.ota-card manages its
   own padding at every width) */
@media (max-width: 991.98px) {
    .collapse > .card.card-body { padding-top: 1.25rem; padding-bottom: 1.25rem; }
}

/* Justified text produces uneven word gaps in narrow columns */
@media (max-width: 575.98px) {
    .text-justify { text-align: left; }
}
