/*
 * BACDS 1726 Ball
 * Shared styles for index.htm, staff.htm, schedule.htm, program.htm, and register.htm
 */

/* =========================================================
   1. Shared design system and base styles
   ========================================================= */

:root {
    --page: #fdf8f0;
    --paper: #fffaf2;
    --text: #222;
    --heading: #4a1a00;
    --accent: #7a3000;
    --visited: #5a2000;
    --rule: #b8a090;
}

*, *::before, *::after {
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
}

body {
    margin: 0;
    padding: 0;
    font-family: Georgia, "Times New Roman", serif;
    background: var(--page);
    color: var(--text);
    line-height: 1.65;
}

.container {
    margin: 0 auto;
    padding-bottom: 48px;
}

.page-header {
    max-width: 800px;
    margin: 0 auto;
    text-align: center;
}

h1 {
    margin: 28px 0 4px;
    font-size: clamp(1.4rem, 5vw, 2rem);
    font-weight: normal;
    letter-spacing: 0.02em;
}

.year {
    display: block;
    margin: 8px 0 16px;
    color: var(--heading);
    font-size: clamp(3.5rem, 14vw, 6rem);
    font-weight: bold;
    line-height: 1;
}

.page-title {
    margin: 0 0 10px;
    color: var(--accent);
    font-size: clamp(1.25rem, 4vw, 1.75rem);
    font-weight: normal;
    letter-spacing: 0.025em;
}

.page-intro {
    max-width: 650px;
    margin: 0 auto 14px;
    text-align: center;
    font-style: italic;
}

hr {
    border: 0;
    border-top: 1px solid var(--rule);
    margin: 16px 0;
}

a {
    color: var(--accent);
    text-decoration-thickness: 1px;
    text-underline-offset: 0.14em;
}

a:visited {
    color: var(--visited);
}

a:hover,
a:focus-visible {
    text-decoration-thickness: 2px;
}

.links-nav {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 6px 0;
    margin: 0;
    padding: 8px 0;
    list-style: none;
}

.links-nav li {
    padding: 0 10px;
    border-right: 1px solid var(--rule);
    line-height: 1.4;
}

.links-nav li:last-child {
    border-right: 0;
}

.links-nav a[aria-current="page"] {
    color: var(--heading);
    font-weight: bold;
    text-decoration: none;
}

.links-nav .nav-placeholder {
    color: #777;
    font-style: italic;
    cursor: default;
}

.back-to-top {
    margin: 2rem 0 0;
    text-align: center;
    font-size: 0.92rem;
}

.page-footer {
    max-width: 800px;
    margin: 2rem auto 0;
    text-align: center;
    font-size: 0.9rem;
}

.page-footer p {
    text-align: center;
}

/* =========================================================
   2. Home page
   ========================================================= */

.home-page {
    line-height: 1.6;
}

.home-page .container {
    max-width: 800px;
    padding: 0 20px 48px;
    text-align: center;
}

.home-page img.hero {
    max-width: 100%;
    height: auto;
    margin: 8px 0;
}

.home-page h2 {
    margin: 12px 0;
    font-size: clamp(1rem, 3vw, 1.25rem);
    font-weight: normal;
    line-height: 1.8;
}

.home-page p {
    margin: 0 0 1rem;
    text-align: justify;
}

.home-page strong {
    color: var(--accent);
}

.home-page .message {
    margin-top: 8px;
    text-align: left;
}

.home-page .message h2 {
    margin: 1.5rem 0 0.6rem;
    padding-bottom: 4px;
    border-bottom: 1px solid var(--rule);
    font-size: 1.2rem;
    font-weight: bold;
    text-align: left;
}

.home-page .program {
    margin-top: 1rem;
    text-align: left;
}

.home-page .program h2 {
    margin: 1.5rem 0 0.8rem;
    padding-bottom: 4px;
    border-bottom: 1px solid var(--rule);
    font-size: 1.2rem;
    font-weight: bold;
    text-align: left;
}
.home-page .program-title {
    text-align: center;
}


.home-page .program-set {
    columns: 2;
    column-gap: 2.5rem;
    margin-bottom: 1.4rem;
    line-height: 1.9;
}

.home-page .program-set br {
    break-after: avoid;
}

.home-page .program-set .set-name {
    display: block;
    margin-bottom: 4px;
    border-bottom: 1px dotted var(--rule);
    font-size: 1.05rem;
    font-variant: small-caps;
    font-weight: bold;
}

.home-page .back-to-top {
    text-align: center;
}

/* =========================================================
   3. Staff page
   ========================================================= */

.staff-page .container {
    width: min(100% - 40px, 980px);
}

.staff-page .staff-section {
    margin-top: 1.3rem;
}

.staff-page .section-title {
    margin: 0 0 0.25rem;
    padding-bottom: 0.35rem;
    border-bottom: 1px solid var(--rule);
    color: var(--heading);
    font-size: clamp(1.45rem, 4vw, 2rem);
    font-weight: normal;
    text-align: center;
    letter-spacing: 0.02em;
}

.staff-page .staff-member {
    display: grid;
    grid-template-columns: minmax(220px, 290px) minmax(0, 1fr);
    gap: clamp(1.4rem, 4vw, 2.5rem);
    align-items: start;
    padding: 2.2rem 0;
    border-bottom: 1px solid var(--rule);
}

.staff-page .staff-member.reverse {
    grid-template-columns: minmax(0, 1fr) minmax(220px, 290px);
}

.staff-page .staff-member.reverse .staff-photo {
    order: 2;
}

.staff-page .staff-member.reverse .staff-bio {
    order: 1;
}

.staff-page .staff-photo {
    margin: 0;
}

.staff-page .photo-frame {
    padding: 8px;
    border: 1px solid var(--rule);
    background: var(--paper);
    box-shadow: 0 4px 14px rgba(74, 26, 0, 0.09);
}

.staff-page .photo-frame img {
    display: block;
    width: 100%;
    height: auto;
}

.staff-page .portrait-pair {
    position: relative;
    padding-right: 30px;
    padding-bottom: 34px;
}

.staff-page .portrait-pair .primary-photo {
    width: calc(100% - 12px);
}

.staff-page .portrait-pair .secondary-photo {
    position: absolute;
    right: 0;
    bottom: 0;
    width: 44%;
    padding: 6px;
    border: 1px solid var(--rule);
    background: var(--page);
    box-shadow: 0 5px 15px rgba(74, 26, 0, 0.18);
}

.staff-page .portrait-pair .secondary-photo img {
    aspect-ratio: 3 / 4;
    object-fit: cover;
    object-position: center 25%;
}

.staff-page .staff-bio h3 {
    margin: -0.12rem 0 0.05rem;
    padding: 0;
    color: var(--heading);
    font-size: clamp(1.45rem, 3.5vw, 1.9rem);
    font-weight: normal;
    line-height: 1.25;
    text-align: left;
    text-indent: 0;
}

.staff-page .staff-role {
    margin: 0 0 1rem;
    color: var(--accent);
    font-size: 0.86rem;
    font-variant: small-caps;
    font-weight: bold;
    letter-spacing: 0.09em;
}

.staff-page .staff-bio p {
    margin: 0 0 1rem;
    text-align: justify;
    hyphens: auto;
}

.staff-page .staff-bio p:last-child {
    margin-bottom: 0;
}

/* =========================================================
   4. Dance program page
   ========================================================= */

.program-page .container {
    width: min(100% - 40px, 980px);
}

.program-page .page-intro {
    max-width: 690px;
}

.program-page .section-title {
    margin: 1.15rem 0 0.65rem;
    padding-bottom: 0.35rem;
    border-bottom: 1px solid var(--rule);
    color: var(--heading);
    font-size: clamp(1.35rem, 4vw, 1.8rem);
    font-weight: normal;
    text-align: center;
    letter-spacing: 0.02em;
}

.program-page .section-title-no-rule {
    padding-bottom: 0;
    border-bottom: 0;
}

.program-page .notation {
    margin: 1rem 0 1.4rem;
    padding: 1rem 1.15rem;
    border: 1px solid var(--rule);
    background: var(--paper);
    box-shadow: 0 3px 12px rgba(74, 26, 0, 0.06);
}

.program-page .notation p {
    margin: 0.45rem 0;
}

.program-page .notation p:first-child {
    margin-top: 0;
}

.program-page .notation p:last-child {
    margin-bottom: 0;
}

.program-page .abbreviations {
    display: flex;
    flex-wrap: wrap;
    gap: 0.25rem 1.25rem;
    margin: 0.35rem 0 0.75rem;
}

.program-page .abbreviations span {
    white-space: nowrap;
}

.program-page .program-index {
    columns: 2;
    column-gap: 2.5rem;
    max-width: 760px;
    margin: 0.8rem auto 1rem;
    padding-left: 0;
    list-style: none;
    line-height: 1.8;
}

.program-page .program-index li {
    break-inside: avoid;
    padding-right: 0.75rem;
}

.program-page .dance-rule {
    margin: 2rem 0 0;
}

.program-page .dance-block + .dance-rule {
    margin-top: 0.35rem;
}

.program-page .dance-block {
    scroll-margin-top: 1rem;
    padding: 1.25rem 0 0.2rem;
}

.program-page .dance-title {
    margin: 0 0 0.35rem;
    color: var(--heading);
    font-size: clamp(1.45rem, 4vw, 1.9rem);
    font-weight: normal;
    line-height: 1.25;
}

.program-page .dance-meta {
    margin: 0 0 1rem;
}

.program-page .meta-row {
    display: grid;
    grid-template-columns: 6.2rem minmax(0, 1fr);
    gap: 0.6rem;
}

.program-page .dance-meta dt {
    color: var(--accent);
    font-weight: bold;
}

.program-page .dance-meta dd {
    margin: 0;
}

.program-page .meta-note {
    font-style: italic;
}

.program-page .unavailable {
    color: #555;
    font-style: italic;
}

.program-page .dance-note {
    margin: -0.25rem 0 1rem;
    padding: 0.5rem 0.7rem;
    border-left: 3px solid var(--rule);
    background: rgba(255, 250, 242, 0.7);
}

.program-page .dance-note strong {
    color: var(--accent);
}

.program-page .dance-directions {
    width: 100%;
    border-collapse: collapse;
    font-size: 1rem;
    line-height: 1.25;
}

.program-page .dance-directions th,
.program-page .dance-directions td {
    padding: 0.02rem 0.25rem;
    vertical-align: top;
}

.program-page .dance-directions .part {
    width: 4.1rem;
    padding-left: 0;
    color: var(--heading);
    font-weight: bold;
    text-align: left;
    white-space: nowrap;
}

.program-page .dance-directions .counts {
    width: 4.5rem;
    white-space: nowrap;
}

.program-page .dance-directions .action {
    padding-right: 0;
}

.program-page .dance-return {
    margin: 0.85rem 0 0;
    text-align: right;
    font-size: 0.88rem;
}


/* =========================================================
   5. Schedule page
   ========================================================= */

.schedule-page .container {
    width: min(100% - 40px, 980px);
}

.schedule-page .page-intro {
    max-width: 700px;
}

.schedule-page .schedule-list {
    max-width: 820px;
    margin: 1.4rem auto 0;
}

.schedule-page .schedule-event {
    margin: 0 0 1.6rem;
    padding: 1.2rem 1.4rem 1.35rem;
    border: 1px solid var(--rule);
    background: var(--paper);
    box-shadow: 0 3px 12px rgba(74, 26, 0, 0.06);
    scroll-margin-top: 1rem;
}

.schedule-page .featured-event {
    border-width: 2px;
}

.schedule-page .schedule-date {
    margin: 0 0 0.75rem;
    padding-bottom: 0.45rem;
    border-bottom: 1px solid var(--rule);
    color: var(--heading);
    font-size: clamp(1.3rem, 4vw, 1.75rem);
    font-weight: normal;
    text-align: center;
    letter-spacing: 0.02em;
}

.schedule-page .schedule-event-title {
    margin: 0;
    color: var(--heading);
    font-size: clamp(1.3rem, 3.5vw, 1.65rem);
    font-weight: normal;
    line-height: 1.3;
    text-align: center;
}

.schedule-page .schedule-tagline {
    margin: 0.15rem 0 1rem;
    color: var(--accent);
    font-style: italic;
    text-align: center;
}

.schedule-page .schedule-details {
    margin: 0;
}

.schedule-page .schedule-row {
    display: grid;
    grid-template-columns: 8.5rem minmax(0, 1fr);
    gap: 0.75rem;
    padding: 0.28rem 0;
}

.schedule-page .schedule-details dt {
    color: var(--accent);
    font-weight: bold;
}

.schedule-page .schedule-details dd {
    margin: 0;
}

.schedule-page .schedule-location {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 240px;
    gap: 1rem;
    align-items: start;
}

.schedule-page .schedule-location-text {
    min-width: 0;
}

.schedule-page .schedule-map {
    display: block;
    width: 240px;
    height: 180px;
    border: 1px solid var(--rule);
    background: var(--page);
}

.schedule-page .schedule-aside {
    font-size: 0.92rem;
    font-style: italic;
}

.schedule-page .schedule-note {
    margin: 1rem 0 0;
    padding: 0.65rem 0.8rem;
    border-left: 3px solid var(--rule);
    background: rgba(253, 248, 240, 0.78);
}

.schedule-page .schedule-note strong {
    color: var(--accent);
}


/* =========================================================
   6. Registration page
   ========================================================= */

.register-page .container {
    width: min(100% - 40px, 980px);
}

.register-page .registration-content {
    max-width: 900px;
    margin: 1.4rem auto 0;
}

.register-page .registration-reminder {
    margin: 0 0 1.2rem;
    padding: 1rem 1.15rem;
    border: 1px solid var(--rule);
    background: var(--paper);
    box-shadow: 0 3px 12px rgba(74, 26, 0, 0.06);
}

.register-page .registration-reminder p {
    margin: 0;
}

.register-page .registration-reminder strong {
    color: var(--accent);
}

.register-page .registration-warning {
    margin: 0 0 1.4rem;
    padding: 0.85rem 1rem;
    border: 2px solid var(--accent);
    background: #fff1dc;
    color: var(--heading);
    text-align: center;
    box-shadow: 0 3px 12px rgba(74, 26, 0, 0.08);
}

.register-page .registration-warning p {
    margin: 0;
}

.register-page .registration-form-section {
    margin-top: 1.2rem;
}

.register-page .section-title {
    margin: 0 0 0.8rem;
    padding-bottom: 0.35rem;
    border-bottom: 1px solid var(--rule);
    color: var(--heading);
    font-size: clamp(1.35rem, 4vw, 1.8rem);
    font-weight: normal;
    text-align: center;
    letter-spacing: 0.02em;
}

.register-page .jotform-frame {
    overflow: hidden;
    border: 1px solid var(--rule);
    background: #fff;
    box-shadow: 0 3px 12px rgba(74, 26, 0, 0.06);
}

.register-page .jotform-frame iframe {
    display: block;
    width: 100%;
    min-height: 0;
    border: 0;
    background: #fff;
}

.register-page .form-fallback {
    margin: 0.75rem 0 0;
    text-align: center;
    font-size: 0.92rem;
}

.visually-hidden {
    position: absolute !important;
    width: 1px !important;
    height: 1px !important;
    padding: 0 !important;
    margin: -1px !important;
    overflow: hidden !important;
    clip: rect(0, 0, 0, 0) !important;
    white-space: nowrap !important;
    border: 0 !important;
}

/* =========================================================
   7. Responsive layouts
   ========================================================= */

@media (max-width: 720px) {
    .staff-page .container {
        width: min(100% - 28px, 980px);
    }

    .staff-page .staff-member,
    .staff-page .staff-member.reverse {
        grid-template-columns: 1fr;
        gap: 1.35rem;
        padding: 1.8rem 0;
    }

    .staff-page .staff-member.reverse .staff-photo,
    .staff-page .staff-member.reverse .staff-bio {
        order: initial;
    }

    .staff-page .staff-photo {
        width: min(100%, 330px);
        margin: 0 auto;
    }

    .staff-page .staff-bio h3,
    .staff-page .staff-role {
        text-align: left;
    }

    .staff-page .staff-bio p {
        text-align: left;
        hyphens: none;
    }
}

@media (max-width: 620px) {

    .register-page .container {
        width: min(100% - 28px, 980px);
    }

    .register-page .registration-reminder,
    .register-page .registration-warning {
        padding: 0.85rem;
    }


    .schedule-page .container {
        width: min(100% - 28px, 980px);
    }

    .schedule-page .schedule-event {
        padding: 1rem;
    }

    .schedule-page .schedule-row {
        grid-template-columns: 1fr;
        gap: 0;
        padding: 0.38rem 0;
    }

    .schedule-page .schedule-location {
        grid-template-columns: 1fr;
        gap: 0.75rem;
    }

    .schedule-page .schedule-map {
        width: min(100%, 360px);
        height: 210px;
    }

    .program-page .container {
        width: min(100% - 28px, 980px);
    }

    .program-page .program-index {
        columns: 1;
    }

    .program-page .meta-row {
        grid-template-columns: 5.6rem minmax(0, 1fr);
        gap: 0.35rem;
    }

    .program-page .dance-directions {
        font-size: 0.96rem;
    }

    .program-page .dance-directions .part {
        width: 3rem;
    }

    .program-page .dance-directions .counts {
        width: 3.9rem;
    }
}

@media (max-width: 520px) {
    .home-page .program-set {
        columns: 1;
    }
}

@media (max-width: 390px) {
    .program-page .dance-directions th,
    .program-page .dance-directions td {
        padding-right: 0.12rem;
        padding-left: 0.12rem;
    }

    .program-page .dance-directions .part {
        width: 2.65rem;
    }

    .program-page .dance-directions .counts {
        width: 3.55rem;
    }
}

@media (prefers-reduced-motion: reduce) {
    html {
        scroll-behavior: auto;
    }
}

/* =========================================================
   8. Print styles
   ========================================================= */

@media print {

    .register-page .registration-warning,
    .register-page .registration-reminder {
        box-shadow: none;
    }

    .register-page .registration-form-section {
        display: none;
    }

    body {
        background: #fff;
    }

    .links-nav,
    .back-to-top {
        display: none;
    }

    a {
        color: inherit;
        text-decoration: none;
    }

    .staff-page .staff-member {
        break-inside: avoid;
    }

    .schedule-page .schedule-event {
        break-inside: avoid;
        box-shadow: none;
    }

    .schedule-page .schedule-map {
        display: none;
    }

    .program-page .dance-return {
        display: none;
    }

    .program-page .notation {
        box-shadow: none;
    }

    .program-page .dance-block {
        break-inside: avoid;
    }
}

/* =========================================================
   9. Contact page
   ========================================================= */

.contact-page .container {
    width: min(100% - 40px, 980px);
}

.contact-page .contact-content {
    max-width: 820px;
    margin: 1.4rem auto 0;
}

.contact-page .contact-list {
    display: grid;
    gap: 1rem;
}

.contact-page .contact-card {
    padding: 1.15rem 1.3rem 1.2rem;
    border: 1px solid var(--rule);
    background: var(--paper);
    box-shadow: 0 3px 12px rgba(74, 26, 0, 0.06);
}

.contact-page .contact-card h2 {
    margin: 0 0 0.45rem;
    padding-bottom: 0.35rem;
    border-bottom: 1px solid var(--rule);
    color: var(--heading);
    font-size: clamp(1.3rem, 3.5vw, 1.65rem);
    font-weight: normal;
    line-height: 1.3;
}

.contact-page .contact-card p {
    margin: 0.55rem 0 0;
}

.contact-page .contact-name {
    color: var(--text);
}

.contact-page .contact-name strong {
    color: var(--accent);
}

.contact-page .contact-email-link {
    font-weight: bold;
}

.contact-page .contact-privacy-note,
.contact-page .contact-noscript {
    margin: 1rem 0 0;
    color: #555;
    font-size: 0.9rem;
    font-style: italic;
    text-align: center;
}

@media (max-width: 620px) {
    .contact-page .container {
        width: min(100% - 28px, 980px);
    }

    .contact-page .contact-card {
        padding: 1rem;
    }
}

@media print {
    .contact-page .contact-card {
        break-inside: avoid;
        box-shadow: none;
    }

    .contact-page .contact-privacy-note,
    .contact-page .contact-noscript {
        display: none;
    }
}
