/* =========================================================
Responsive: Mobile Layouts and Navigation
========================================================= */
@media (max-width: 768px) {
    .page-shell,
    .section-inner,
    .navbar,
    .hero,
    .play-block,
    .detail-section,
    .filters-section,
    .auth-shell,
    .form-card,
    .wide-form-card,
    .page-hero,
    .events-hero,
    .flash-container,
    .backoffice-nav,
    .admin-wide-container {
        width: calc(100% - 32px);
    }

    .navbar {
        margin-top: 12px;
        border-radius: 22px;
    }

    .hero {
        padding: 46px 0 42px;
    }

    .hero h1,
    .page-hero h1,
    .events-hero h1,
    .detail-content h1 {
        font-size: 40px;
        line-height: 0.98;
    }

    .hero-description,
    .about-description,
    .event-description,
    .page-hero p,
    .events-hero p {
        font-size: 16px;
        line-height: 1.55;
    }

    .hero-motto-line {
        margin-top: -6px;
        font-size: 12px;
        line-height: 1.3;
    }

    .hero-buttons,
    .center-actions,
    .page-actions,
    .dashboard-quick-actions,
    .registered-event-actions,
    .table-actions {
        gap: 9px;
    }

    .hero-buttons .primary-button,
    .hero-buttons .secondary-button {
        flex: 1 1 190px;
    }

    .hero-scroll-indicator {
        display: none;
    }

    .hero-image-hover {
        border-width: 6px;
        border-radius: 22px;
    }

    .hero-image-hover img {
        border-radius: 16px;
    }

    .content-band,
    .events-section,
    .memory-band,
    .about-section {
        padding: 46px 16px;
    }

    .structure-explainer-band {
        padding-top: 20px;
        padding-bottom: 24px;
    }

    .department-section-band {
        padding-top: 30px;
        padding-bottom: 34px;
    }

    .department-detail-hero-band {
        padding-top: 30px;
        padding-bottom: 12px;
    }

    .department-detail-main-band {
        padding-top: 12px;
        padding-bottom: 20px;
    }

    .departments-list-band {
        padding-top: 38px;
        padding-bottom: 40px;
    }

    .page-hero,
    .events-hero {
        padding: 58px 0 34px;
    }

    .section-title {
        margin-bottom: 28px;
    }

    .section-title h2 {
        font-size: 34px;
    }

    .play-block {
        margin-bottom: 44px;
        padding: 26px;
        border-radius: 24px;
    }

    .play-block h2 {
        font-size: 34px;
    }

    .play-block p {
        font-size: 16px;
    }

    .filters-section {
        margin-bottom: 34px;
        padding: 12px;
        border-radius: 20px;
        overflow: visible;
        animation: none;
        transform: none;
        will-change: auto;
    }

    .filters-main-row {
        grid-template-columns: 1fr 1fr;
        gap: 10px;
    }

    .filters-main-row input,
    .filters-main-row .filter-clear-button {
        grid-column: 1 / -1;
    }

    .filters-custom-row,
    .form-grid {
        grid-template-columns: 1fr;
    }

    .filters-custom-row {
        transform: none;
        transition:
            max-height 320ms cubic-bezier(0.22, 1, 0.36, 1),
            opacity 220ms ease-out;
        will-change: max-height, opacity;
    }

    .filters-custom-row.is-open {
        max-height: 220px;
        padding-bottom: 2px;
        transform: none;
    }

    .filters-section input,
    .filters-section select {
        min-height: 44px;
        -webkit-tap-highlight-color: transparent;
    }

    .events-result-count,
    .admin-filter-count {
        font-size: 13px;
    }

    .events-grid,
    .card-grid,
    .about-features,
    .registered-events-grid,
    .related-event-grid,
    .dashboard-metric-grid,
    .snapshot-grid,
    .personal-dashboard .stat-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: 14px;
    }

    .department-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: 10px;
    }

    .department-event-grid {
        grid-template-columns: 1fr;
        gap: 14px;
    }

    .event-details {
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: 10px;
    }

    .event-neighbor-nav {
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: 12px;
        margin-bottom: 40px;
    }

    .poster-card,
    .info-card,
    .feature,
    .registered-event-card,
    .related-event-card,
    .event-neighbor-card,
    .dashboard-metric-card,
    .snapshot-card,
    .profile-identity-panel,
    .next-event-highlight,
    .settings-card,
    .settings-identity-card,
    .auth-card,
    .form-card {
        border-radius: 18px;
    }

    .info-card,
    .feature,
    .admin-card,
    .registered-event-card,
    .stat-card {
        padding: 16px;
    }

    .poster-info {
        padding: 14px;
    }

    .poster-card img {
        aspect-ratio: 1 / 0.9;
    }

    .poster-info h3,
    .info-card h3,
    .feature h3,
    .registered-event-card h3,
    .related-event-card h3,
    .event-neighbor-card strong {
        font-size: 20px;
        line-height: 1.05;
    }

    .event-card-meta,
    .info-card p,
    .feature p,
    .registered-event-card p,
    .related-event-card p {
        font-size: 13px;
        line-height: 1.35;
    }

    .event-category,
    .small-title,
    .card-label,
    .detail-box h3 {
        font-size: 11px;
        letter-spacing: 0.7px;
    }

    .state-badge {
        padding: 6px 8px;
        font-size: 10px;
        white-space: normal;
    }

    .poster-badges {
        gap: 6px;
    }

    .info-card img {
        height: 130px;
        margin-bottom: 12px;
        border-radius: 14px;
    }

    .department-card {
        gap: 10px;
        padding: 10px;
        min-height: 0;
    }

    .department-card img {
        width: 100%;
        height: clamp(132px, 24vw, 150px);
        border-radius: 12px;
    }

    .department-card-content {
        padding: 0;
        min-height: 0;
    }

    .department-card-copy {
        gap: 7px;
    }

    .department-number {
        font-size: 20px;
    }

    .department-card h3 {
        margin-bottom: 2px;
        font-size: 18px;
        line-height: 1.08;
    }

    .department-card p {
        font-size: 13px;
        line-height: 1.35;
    }

    .department-card-bullets {
        display: none;
    }

    .related-events {
        margin-top: 9px;
        padding-top: 9px;
    }

    .related-events a {
        font-size: 13px;
        line-height: 1.35;
    }

    .department-card-actions {
        padding-top: 12px;
        justify-content: flex-start;
        margin-top: auto;
    }

    .department-card-actions .secondary-button {
        width: 100%;
        min-height: 36px;
        padding: 8px 10px;
        font-size: 10px;
    }

    .section-heading {
        margin-bottom: 14px;
    }

    .section-heading h2 {
        font-size: 26px;
    }

    .department-detail-hero {
        min-height: 360px;
        border-radius: 24px;
    }

    .department-detail-hero::after {
        background:
            linear-gradient(180deg, rgba(255, 244, 231, 0.14) 0%, rgba(255, 244, 231, 0.05) 50%, rgba(255, 228, 204, 0.12) 100%);
    }

    .department-detail-hero-title {
        left: 16px;
        right: 16px;
        top: 16px;
        max-width: none;
    }

    .department-type-pill {
        margin: 4px 0 14px;
        padding: 7px 10px;
        font-size: 11px;
    }

    .department-detail-hero-title h1 {
        margin-top: 12px;
        font-size: 40px;
        line-height: 0.98;
    }

    .department-detail-hero > img {
        object-position: center 54%;
    }

    .department-detail-about-card,
    .department-detail-responsibilities-card,
    .department-detail-contact-card {
        gap: 9px;
    }

    .department-detail-long-text {
        font-size: 15px;
        line-height: 1.58;
    }

    .department-responsibility-list {
        gap: 8px;
    }

    .department-responsibility-list li {
        padding: 10px 10px 10px 38px;
        font-size: 13px;
    }

    .department-responsibility-list li::before {
        left: 10px;
        top: 11px;
    }

    .department-contact-link {
        width: 100%;
    }

    .department-detail-card img {
        height: 168px;
    }

    .department-team-band {
        padding-top: 12px;
        padding-bottom: 32px;
    }

    .department-related-events-band {
        padding-top: 8px;
        padding-bottom: 26px;
    }

    .department-related-events-section {
        padding: 18px;
        border-radius: 22px;
    }

    .department-related-events-section .section-heading {
        margin-bottom: 18px;
    }

    .department-event-group + .department-event-group {
        margin-top: 24px;
        padding-top: 22px;
    }

    .department-event-group-heading {
        margin-bottom: 12px;
    }

    .department-event-group-heading h3 {
        font-size: 22px;
    }

    .department-backlink-band {
        padding-top: 4px;
        padding-bottom: 38px;
    }

    .department-leadership-grid,
    .department-member-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: 12px;
    }

    .department-member-photo img {
        object-position: center 65%;
    }

    .department-member-card--highlight {
        padding: 12px;
        border-radius: 18px;
    }

    .department-member-photo {
        height: 170px;
        border-radius: 14px;
    }

    .department-member-card--compact {
        padding: 10px;
        gap: 10px;
        border-radius: 18px;
    }

    .department-member-avatar {
        width: 46px;
        height: 46px;
        flex-basis: 46px;
    }

    .department-member-avatar .department-member-placeholder {
        font-size: 15px;
    }

    .department-member-copy p {
        font-size: 11px;
    }

    .department-member-card--compact h3 {
        font-size: 14px;
    }

    .su-photo-band {
        width: calc(100% - 32px);
        margin-bottom: 4px;
    }

    .su-photo-frame {
        border-radius: 22px;
    }

    .su-photo-frame img {
        height: 280px;
        object-position: center 53%;
    }

    .structure-explainer {
        padding: 18px;
        border-radius: 24px;
    }

    .structure-intro {
        margin-bottom: 14px;
    }

    .department-section-band .section-heading {
        margin-bottom: 18px;
    }

    .department-section-band .section-heading::after {
        width: 58px;
        margin-top: 12px;
    }

    .structure-flow {
        grid-template-columns: 1fr;
        gap: 16px;
    }

    .structure-connector {
        min-height: 46px;
        width: 24px;
        justify-self: center;
        opacity: 1;
        animation: none;
        background:
            linear-gradient(var(--connector-line), var(--connector-line)) no-repeat center / 2px calc(100% - 24px);
    }

    .structure-connector::before,
    .structure-connector::after {
        display: block;
        left: 50%;
        right: auto;
        top: auto;
        width: 10px;
        height: 10px;
        transform: translateX(-50%);
    }

    .structure-connector::before {
        top: 4px;
        clip-path: polygon(50% 0, 100% 100%, 0 100%);
    }

    .structure-connector::after {
        bottom: 4px;
        clip-path: polygon(0 0, 100% 0, 50% 100%);
    }

    .structure-node {
        min-height: 0;
        padding: 16px;
        border-radius: 18px;
    }

    .structure-node h3 {
        margin: 16px 0 8px;
        font-size: 22px;
    }

    .structure-node p {
        font-size: 14px;
        line-height: 1.42;
    }

    .detail-section {
        gap: 28px;
        padding-top: 48px;
    }

    .detail-image::before {
        left: -14px;
        bottom: -16px;
    }

    .detail-image img {
        max-height: 430px;
        border-width: 7px;
        border-radius: 22px;
    }

    .event-description {
        margin-bottom: 22px;
    }

    .detail-box {
        padding: 13px;
    }

    .detail-box p {
        font-size: 13px;
        line-height: 1.35;
    }

    .event-action-message,
    .event-ajax-message {
        padding: 13px 14px;
        font-size: 14px;
    }

    .event-discovery-section {
        width: calc(100% - 32px);
        margin: -6px auto 58px;
    }

    .event-neighbor-card {
        min-height: 118px;
        padding: 15px;
    }

    .event-neighbor-card-next {
        text-align: left;
        align-items: flex-start;
    }

    .event-neighbor-card-next .event-neighbor-badges {
        justify-content: flex-start;
    }

    .related-event-card {
        min-height: 166px;
        padding: 15px;
    }

    .profile-identity-panel,
    .next-event-highlight,
    .settings-card,
    .settings-identity-card {
        padding: 20px;
    }

    .profile-identity-header {
        align-items: flex-start;
        gap: 12px;
    }

    .profile-identity-header h1,
    .next-event-highlight h2,
    .dashboard-section-heading h2,
    .settings-card h2 {
        font-size: 30px;
    }

    .role-badge {
        margin: 0 4px 6px 0;
        white-space: normal;
    }

    .profile-detail-grid p,
    .profile-list p {
        display: grid;
        gap: 3px;
    }

    .profile-detail-grid span,
    .profile-list span {
        max-width: none;
        text-align: left;
    }

    .next-event-highlight {
        min-height: 0;
    }

    .next-event-highlight::after {
        width: 132px;
        height: 132px;
        right: -54px;
        bottom: -54px;
    }

    .snapshot-card {
        min-height: 132px;
        padding: 16px;
    }

    .snapshot-card strong {
        font-size: 26px;
    }

    .registered-event-card-header {
        align-items: flex-start;
        gap: 8px;
        margin-bottom: 8px;
    }

    .registered-event-pills {
        gap: 6px;
        margin-bottom: 12px;
    }

    .registered-event-pills span {
        padding: 6px 8px;
        font-size: 11px;
    }

    .registered-event-meta {
        gap: 7px;
        margin-bottom: 14px;
    }

    .registered-event-meta p {
        grid-template-columns: 1fr;
        gap: 2px;
        font-size: 13px;
    }

    .su-calendar-layout {
        gap: 18px;
    }

    .calendar-timeline-card {
        padding: 18px;
        border-radius: 18px;
    }

    .timeline-month {
        margin: 18px 0 10px;
        font-size: 15px;
    }

    .timeline-item {
        grid-template-columns: 54px 1fr;
        gap: 10px;
        margin-bottom: 12px;
    }

    .timeline-date {
        width: 54px;
        height: 54px;
        border-radius: 16px;
    }

    .timeline-month-events::before {
        top: 8px;
        bottom: 20px;
        left: 26px;
    }

    .timeline-content h4 {
        font-size: 18px;
    }

    .timeline-content p {
        font-size: 13px;
    }

    .auth-main {
        align-items: flex-start;
        padding: 18px 0 28px;
    }

    .auth-shell {
        gap: 16px;
    }

    .auth-brand-panel {
        min-height: 220px;
        padding: 26px;
        justify-content: center;
        text-align: center;
        border-radius: 24px;
    }

    .auth-brand-copy h2 {
        font-size: 34px;
    }

    .auth-home-link {
        margin-top: 22px;
        align-self: center;
    }

    .auth-card {
        padding: 24px;
    }

    .auth-card h1 {
        font-size: 38px;
    }

    .backoffice-nav {
        margin-top: 18px;
        margin-bottom: 34px;
        justify-content: flex-start;
        gap: 8px;
    }

    .backoffice-nav a {
        padding: 10px 12px;
        font-size: 12px;
    }

    .admin-dashboard-shell {
        gap: 32px;
    }

    .dashboard-metric-card {
        min-height: 118px;
        padding: 16px;
    }

    .dashboard-metric-card strong {
        font-size: 32px;
    }

    .dashboard-attention-item {
        grid-template-columns: 1fr;
        gap: 7px;
        padding: 15px;
    }

    .admin-filter-panel {
        grid-template-columns: 1fr 1fr;
        padding: 12px;
        border-radius: 18px;
    }

    .admin-filter-panel input,
    .admin-filter-panel button {
        grid-column: 1 / -1;
    }

    .admin-list-header,
    .admin-inline-actions {
        align-items: flex-start;
        flex-direction: column;
    }

    .admin-context-actions {
        justify-content: flex-start;
    }

    .admin-list-section .table-wrapper {
        background: transparent;
        border: 0;
        border-radius: 0;
        box-shadow: none;
        overflow: visible;
    }

    .admin-table,
    .admin-table tbody,
    .admin-table tr,
    .admin-table td {
        width: 100%;
        min-width: 0;
        display: block;
    }

    .admin-table thead {
        display: none;
    }

    .admin-table tbody {
        display: grid;
        gap: 14px;
    }

    .admin-table tr {
        padding: 16px;
        background: var(--white);
        border: 1px solid var(--border);
        border-radius: 18px;
        box-shadow: var(--soft-shadow);
    }

    .admin-table tr:hover {
        background: var(--white);
    }

    .admin-table td {
        padding: 8px 0;
        border-bottom: 1px solid var(--border);
    }

    .admin-table td:last-child {
        border-bottom: 0;
        padding-bottom: 0;
    }

    .admin-table td::before {
        content: attr(data-label);
        display: block;
        margin-bottom: 3px;
        color: var(--dark-gray);
        font-family: var(--font-subtitle);
        font-size: 10px;
        font-weight: 700;
        letter-spacing: 0.6px;
        text-transform: uppercase;
    }

    .admin-events-table td:nth-child(1)::before { content: "Title"; }
    .admin-events-table td:nth-child(2)::before { content: "Date"; }
    .admin-events-table td:nth-child(3)::before { content: "Category"; }
    .admin-events-table td:nth-child(4)::before { content: "Department"; }
    .admin-events-table td:nth-child(5)::before { content: "Status"; }
    .admin-events-table td:nth-child(6)::before { content: "Approval"; }
    .admin-events-table td:nth-child(7)::before { content: "Registrations"; }
    .admin-events-table.is-admin-table td:nth-child(8)::before { content: "Created by"; }
    .admin-events-table.is-admin-table td:nth-child(9)::before,
    .admin-events-table.is-coordinator-table td:nth-child(8)::before { content: "Actions"; }

    .admin-registrations-table td:nth-child(1)::before { content: "Name"; }
    .admin-registrations-table td:nth-child(2)::before { content: "Email"; }
    .admin-registrations-table td:nth-child(3)::before { content: "Account"; }
    .admin-registrations-table td:nth-child(4)::before { content: "Course"; }
    .admin-registrations-table td:nth-child(5)::before { content: "Year"; }
    .admin-registrations-table td:nth-child(6)::before { content: "Registered at"; }
    .admin-registrations-table td:nth-child(7)::before { content: "Action"; }

    .admin-users-table td:nth-child(1)::before { content: "Name"; }
    .admin-users-table td:nth-child(2)::before { content: "Email"; }
    .admin-users-table td:nth-child(3)::before { content: "Role"; }
    .admin-users-table td:nth-child(4)::before { content: "SU Partner"; }
    .admin-users-table td:nth-child(5)::before { content: "Course"; }
    .admin-users-table td:nth-child(6)::before { content: "Year"; }
    .admin-users-table td:nth-child(7)::before { content: "Actions"; }

    .registration-meter {
        min-width: 0;
    }

    .table-actions {
        align-items: stretch;
    }

    .table-actions .small-button,
    .table-actions form,
    .table-actions button {
        width: auto;
    }

    .category-table-heading {
        display: none;
    }

    .category-table-list {
        gap: 14px;
    }

    .category-compact-row {
        display: grid;
        grid-template-columns: 1fr;
        gap: 12px;
        padding: 16px;
        border-radius: 18px;
    }

    .category-compact-row form:first-child {
        grid-template-columns: 1fr;
        gap: 10px;
    }

    .category-name-field,
    .category-create-name-row {
        grid-template-columns: 18px minmax(0, 1fr);
        gap: 10px;
    }

    .category-create-name-row .category-color-pill {
        margin-top: 25px;
    }

    .category-compact-row textarea {
        min-height: 84px;
    }

    .category-compact-actions,
    .category-compact-row > form:last-child,
    .category-compact-row > form:last-child button {
        width: 100%;
    }

    .category-compact-actions {
        justify-content: stretch;
    }

    .category-compact-actions button {
        width: 100%;
    }

    .admin-form-actions,
    .admin-page-actions {
        justify-content: flex-start;
    }

    .admin-danger-form,
    .approval-panel {
        margin-top: -54px;
    }

    .reject-event-form input {
        width: 100%;
    }

    .footer {
        padding: 50px 16px 28px;
    }

    .footer-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: 22px;
    }

    .footer-signature {
        margin-bottom: 28px;
        font-size: 38px;
    }

    .footer-bottom {
        margin-top: 30px;
        align-items: flex-start;
        flex-direction: column;
    }

    .primary-button,
    .secondary-button,
    .success-button {
        max-width: 100%;
        min-height: 42px;
        padding: 10px 15px;
        white-space: normal;
        text-align: center;
    }

    .small-button {
        min-height: 36px;
        padding: 8px 10px;
        font-size: 11px;
    }
}

@media (max-width: 700px) {
    .department-card img {
        height: 130px;
    }
}

@media (max-width: 650px) {
    .department-card img {
        height: 120px;
    }
}

@media (max-width: 600px) {
    .department-card img {
        height: 110px;
    }
}


@media (max-width: 550px) {
    .department-grid {
        grid-template-columns: 1fr;
    }

    .department-leadership-grid,
    .department-member-grid {
        grid-template-columns: 1fr;
    }

    .department-card img {
        height: 200px;
    }

    .department-member-photo {
        height: 250px;
    }

    .department-member-photo img {
        object-position: center 65%;
    }
}
