/*
 * v1.17.0 全站響應式整理層
 * 僅調整前台在桌機、平板與手機的排版，不改變功能、資料或互動邏輯。
 */

.site-body,
.site-body main,
.site-body main > *,
.site-body .container,
.site-body .header-inner,
.site-body .footer-inner,
.site-body .section,
.site-body .article-shell,
.site-body .profile-hero-inner,
.site-body .profile-copy,
.site-body .profile-info-block,
.site-body .profile-visual-cluster,
.site-body .candidate-card,
.site-body .update-card,
.site-body .timeline-card,
.site-body .content-card-detail,
.site-body .content-card-single {
  min-width: 0;
}

.site-body img,
.site-body svg,
.site-body video,
.site-body iframe,
.maintenance-body img,
.maintenance-body svg,
.maintenance-body video,
.maintenance-body iframe {
  max-width: 100%;
}

.site-body :is(
  h1,
  h2,
  h3,
  h4,
  p,
  li,
  dd,
  dt,
  a,
  button,
  summary,
  label,
  small,
  strong
) {
  overflow-wrap: break-word;
}

.site-body :is(
  .article-content,
  .rich-content,
  .timeline-description,
  .council-policy-detail,
  .policy-accordion-content
) :is(pre, code) {
  max-width: 100%;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}

.site-body :is(
  .article-content,
  .rich-content,
  .timeline-description,
  .council-policy-detail,
  .policy-accordion-content
) table {
  width: 100%;
  max-width: 100%;
  display: block;
  overflow-x: auto;
  border-collapse: collapse;
  -webkit-overflow-scrolling: touch;
}

.site-body :is(
  .article-content,
  .rich-content,
  .timeline-description,
  .council-policy-detail,
  .policy-accordion-content
) :is(img, iframe, video, embed, object) {
  max-width: 100% !important;
}

.site-body input,
.site-body select,
.site-body textarea,
.maintenance-body input,
.maintenance-body select,
.maintenance-body textarea {
  min-width: 0;
  max-width: 100%;
}

@media (max-width: 1200px) {
  .site-body .header-inner {
    width: min(100% - 40px, 1360px);
    gap: 24px;
  }

  .site-body .desktop-nav {
    gap: 24px;
    font-size: 15px;
  }

  .site-body .home-hero {
    padding-inline: max(32px, 4vw);
    gap: 36px;
  }

  .site-body .hero-copy h1 {
    font-size: clamp(50px, 5.5vw, 70px);
  }

  .site-body .update-grid,
  .site-body .content-card-grid,
  .site-body .home-content-card-grid,
  .site-body .article-related-cards > div {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 1050px) {
  .site-body .mobile-menu {
    position: relative;
  }

  .site-body .mobile-menu > summary {
    min-width: 48px;
    min-height: 44px;
    padding: 9px 10px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border: 1px solid #c8dce7;
    border-radius: 9px;
    background: #fff;
    list-style: none;
  }

  .site-body .mobile-menu > summary::-webkit-details-marker {
    display: none;
  }

  .site-body .mobile-menu nav {
    top: calc(100% + 10px);
    right: 0;
    width: min(300px, calc(100vw - 24px));
    min-width: 0;
    max-height: calc(100dvh - 92px);
    overflow-y: auto;
    overscroll-behavior: contain;
  }

  .site-body .mobile-menu nav a {
    min-height: 44px;
    display: flex;
    align-items: center;
  }

  .site-body .profile-council-layout,
  .site-body .profile-mayor-layout,
  .site-body .profile-hero-inner {
    min-width: 0;
  }

  .site-body .updates-search-toolbar,
  .site-body .news-filter-toolbar,
  .site-body .candidate-news-toolbar {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .site-body .updates-search-toolbar > :first-child,
  .site-body .news-filter-toolbar > :first-child,
  .site-body .candidate-news-toolbar > :first-child {
    grid-column: 1 / -1;
  }
}

@media (max-width: 900px) {
  .site-body .home-hero {
    min-height: 0;
    grid-template-columns: minmax(0, 1fr);
    gap: 0;
    padding: 20px 32px 0;
    background: linear-gradient(180deg, #fff 0%, #fff 47%, #edf6fa 100%);
  }

  .site-body .hero-copy {
    padding: 0;
  }

  .site-body .hero-copy h1 {
    max-width: 760px;
    font-size: clamp(48px, 9vw, 72px);
  }

  .site-body .hero-copy > p {
    max-width: 720px;
  }

  .site-body .hero-candidate {
    width: min(100%, 680px);
    min-height: 0;
    margin: 20px auto 0;
    padding-top: 18px;
  }

  .site-body .hero-candidate .candidate-portrait {
    width: min(100%, 560px);
    height: min(72vw, 600px);
    min-height: 430px;
  }

  .site-body .hero-cards {
    margin-top: 0;
    transform: translateY(24px);
  }

  .site-body .split-heading {
    align-items: flex-start;
  }

  .site-body .candidate-directory-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .site-body .filter-bar {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .site-body .schedule-map iframe {
    height: min(52vw, 360px);
    min-height: 260px;
  }
}

@media (max-width: 768px) {
  .site-body .container,
  .site-body .footer-inner {
    width: min(100% - 32px, 1180px);
  }

  .site-body .header-inner {
    width: calc(100% - 24px);
    min-height: 68px;
    height: auto;
    padding-block: 8px;
  }

  .site-body .site-header .brand {
    flex: 1 1 auto;
  }

  .site-body .site-header .brand-logo {
    width: 72px;
    height: 42px;
  }

  .site-body .site-header .brand > span {
    max-width: min(44vw, 185px);
  }

  .site-body .home-hero {
    display: grid;
    padding: 16px 20px 0;
  }

  .site-body .hero-copy h1 {
    margin-block: 20px 18px;
    font-size: clamp(40px, 12vw, 60px);
    letter-spacing: -.045em;
  }

  .site-body .hero-actions,
  .site-body .content-card-actions,
  .site-body .content-card-single > div {
    display: grid;
    grid-template-columns: minmax(0, 1fr);
  }

  .site-body .hero-actions .button,
  .site-body .content-card-actions .button,
  .site-body .content-card-single > div .button {
    width: 100%;
    min-width: 0;
    min-height: 50px;
    padding-inline: 18px;
  }

  .site-body .hero-candidate {
    width: 100%;
  }

  .site-body .hero-candidate .candidate-portrait {
    height: min(112vw, 560px);
    min-height: 390px;
  }

  .site-body .hero-nameplate {
    max-width: calc(100% - 16px);
    min-width: 0;
  }

  .site-body .hero-cards {
    grid-template-columns: minmax(0, 1fr);
    transform: none;
  }

  .site-body .home-schedule-strip {
    min-width: 0;
  }

  .site-body .home-schedule-heading h2 {
    white-space: normal;
    font-size: clamp(26px, 8vw, 34px);
  }

  .site-body .section {
    padding-top: 72px;
    padding-bottom: 68px;
  }

  .site-body .section-heading {
    margin-bottom: 28px;
  }

  .site-body .section-heading h2 {
    font-size: clamp(30px, 9vw, 42px);
  }

  .site-body .split-heading,
  .site-body .cta-inner {
    display: grid;
    grid-template-columns: minmax(0, 1fr);
    gap: 16px;
  }

  .site-body .district-chips,
  .site-body .district-area-filter,
  .site-body .schedule-month-filter > div,
  .site-body .policy-front-filter,
  .site-body .tag-filter-bar {
    max-width: 100%;
    flex-wrap: nowrap;
    overflow-x: auto;
    overscroll-behavior-inline: contain;
    scrollbar-width: thin;
    -webkit-overflow-scrolling: touch;
  }

  .site-body .district-chips > *,
  .site-body .district-area-filter > *,
  .site-body .schedule-month-filter > div > *,
  .site-body .policy-front-filter > *,
  .site-body .tag-filter-bar > * {
    flex: 0 0 auto;
  }

  .site-body .candidate-feature-grid,
  .site-body .update-grid,
  .site-body .content-card-grid,
  .site-body .home-content-card-grid,
  .site-body .article-related-cards > div,
  .site-body .candidate-directory-grid,
  .site-body .priority-grid,
  .site-body .resume-grid,
  .site-body .content-card-gallery {
    grid-template-columns: minmax(0, 1fr);
  }

  .site-body .filter-bar {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .site-body .updates-search-toolbar,
  .site-body .news-filter-toolbar,
  .site-body .candidate-news-toolbar,
  .site-body .card-filter-bar {
    grid-template-columns: minmax(0, 1fr);
  }

  .site-body .updates-search-toolbar > *,
  .site-body .news-filter-toolbar > *,
  .site-body .candidate-news-toolbar > * {
    grid-column: auto;
  }

  .site-body .updates-search-toolbar :is(button, .updates-clear),
  .site-body .news-filter-toolbar :is(button, .updates-clear),
  .site-body .candidate-news-toolbar :is(button, .updates-clear),
  .site-body .card-filter-bar button {
    width: 100%;
    justify-content: center;
  }

  .site-body .news-list-page .update-card.compact,
  .site-body .news-list-page .update-card.compact.news-card-minimal {
    grid-template-columns: minmax(0, 1fr);
  }

  .site-body .news-list-page .update-card.compact .update-card-cover,
  .site-body .news-list-page .update-card.compact.news-card-minimal .update-card-cover {
    width: 100%;
    height: auto;
    min-height: 0;
    aspect-ratio: 16 / 9;
    border-right: 0;
    border-bottom: 1px solid var(--line);
  }

  .site-body .news-list-page .update-card.compact .update-card-cover img,
  .site-body .news-list-page .update-card.compact.news-card-minimal .update-card-cover img {
    height: 100%;
  }

  .site-body .news-list-page .update-card.compact .update-card-body {
    padding: 20px;
  }

  .site-body .news-noscript-list {
    padding: 16px;
  }

  .site-body .news-noscript-list article {
    align-items: flex-start;
    flex-direction: column;
    gap: 5px;
  }

  .site-body .page-hero {
    padding: 68px 0 58px;
  }

  .site-body .page-hero h1 {
    font-size: clamp(34px, 10vw, 50px);
    line-height: 1.2;
  }

  .site-body .page-hero p {
    font-size: 16px;
  }

  .site-body .profile-hero {
    padding-top: 34px;
  }

  .site-body .profile-copy h1,
  .site-body .profile-copy h1.candidate-heading-name,
  .site-body .profile-copy h1.candidate-name-full,
  .site-body .profile-council-info-panel h1,
  .site-body .profile-mayor-mobile-name h1 {
    max-width: 100%;
    font-size: clamp(40px, 13vw, 62px);
    line-height: 1.08;
  }

  .site-body .profile-copy .profile-tagline,
  .site-body .profile-council-info-panel .profile-tagline {
    font-size: clamp(19px, 5.5vw, 23px);
  }

  .site-body .profile-council-layout .profile-visual .portrait-large,
  .site-body .profile-mayor-layout .profile-visual .portrait-large {
    width: 100%;
    height: auto;
    min-height: 0;
    max-height: none;
  }

  .site-body .profile-council-layout .profile-visual .portrait-large img,
  .site-body .profile-mayor-layout .profile-visual .portrait-large img {
    width: 100%;
    height: auto;
    max-height: none;
  }

  .site-body .profile-council-info-panel {
    width: 100%;
    min-height: 0;
  }

  .site-body .candidate-profile-actions {
    grid-template-columns: minmax(0, 1fr);
  }

  .site-body .candidate-profile-actions .candidate-action-button {
    width: 100%;
  }

  .site-body .profile-facts div,
  .site-body .profile-council-info-panel .profile-facts div,
  .site-body .profile-service-info dl div,
  .site-body .candidate-donation dl > div,
  .site-body .profile-council-info-panel .candidate-donation dl > div {
    grid-template-columns: minmax(88px, auto) minmax(0, 1fr);
  }

  .site-body .candidate-socials > div {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .site-body .candidate-socials a {
    width: 100%;
    min-width: 0;
    justify-content: center;
  }

  .site-body .mayor-policy-card {
    grid-template-columns: 42px minmax(0, 1fr);
    gap: 14px;
    padding: 20px 18px;
  }

  .site-body .mayor-policy-card .policy-content {
    grid-column: 1 / -1;
  }

  .site-body .policy-category-group > header {
    align-items: flex-start;
    padding: 18px;
  }

  .site-body .policy-subgrid,
  .site-body .policy-related-updates > div,
  .site-body .council-policy-grid {
    grid-template-columns: minmax(0, 1fr);
  }

  .site-body .policy-accordion-body,
  .site-body .council-policy-theme-body {
    padding: 18px;
  }

  .site-body .council-policy-accordion-content {
    padding: 18px;
  }

  .site-body .article-page {
    padding: 24px 12px;
  }

  .site-body .article-shell {
    width: 100%;
    padding: 28px 20px;
  }

  .site-body .article-shell h1,
  .site-body .article-shell h1.article-title-short {
    max-width: 100%;
    font-size: clamp(25px, 7.5vw, 34px);
    white-space: normal;
    text-wrap: pretty;
  }

  .site-body .article-cover {
    height: auto;
    max-height: none;
    object-fit: contain;
  }

  .site-body .article-gallery-thumbs {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .site-body .share-bar {
    align-items: stretch;
  }

  .site-body .share-bar > span {
    flex-basis: 100%;
  }

  .site-body .share-bar button,
  .site-body .share-bar .share-network {
    flex: 1 1 calc(50% - 8px);
    justify-content: center;
  }

  .site-body .schedule-person-filter {
    grid-template-columns: minmax(0, 1fr);
  }

  .site-body .schedule-month-filter {
    align-items: flex-start;
    flex-direction: column;
  }

  .site-body .public-schedule-preview .timeline-entry,
  .site-body .timeline-entry {
    grid-template-columns: 20px minmax(0, 1fr);
  }

  .site-body .public-schedule-preview .schedule-timeline::before,
  .site-body .schedule-timeline::before {
    left: 8px;
  }

  .site-body .public-schedule-preview .timeline-date,
  .site-body .timeline-date {
    grid-column: 2;
    text-align: left;
  }

  .site-body .public-schedule-preview .timeline-calendar-date,
  .site-body .timeline-calendar-date {
    justify-content: flex-start;
    flex-wrap: wrap;
    white-space: normal;
  }

  .site-body .public-schedule-preview .timeline-entry > i,
  .site-body .timeline-entry > i {
    grid-column: 1;
    grid-row: 1 / span 2;
  }

  .site-body .public-schedule-preview .timeline-card,
  .site-body .timeline-card {
    grid-column: 2;
    min-width: 0;
    padding: 20px 18px;
  }

  .site-body .timeline-card-top {
    align-items: flex-start;
    flex-wrap: wrap;
  }

  .site-body .day-schedule-list article,
  .site-body .day-schedule-list dl,
  .site-body .schedule-quick-facts,
  .site-body .schedule-detail-facts,
  .site-body .timeline-expanded {
    grid-template-columns: minmax(0, 1fr);
  }

  .site-body .day-schedule-list .day-schedule-attendees,
  .site-body .schedule-quick-facts .schedule-attendees,
  .site-body .schedule-detail-facts .schedule-detail-attendees {
    grid-column: auto;
  }

  .site-body .timeline-expanded :is(img, .timeline-preview-cover) {
    width: 100%;
    max-width: 100%;
  }

  .site-body .schedule-map > div {
    align-items: flex-start;
    flex-direction: column;
  }

  .site-body .content-card-detail > header,
  .site-body .content-card-single {
    min-width: 0;
  }

  .site-body .content-card-detail h1,
  .site-body .content-card-single h1 {
    font-size: clamp(28px, 9vw, 40px);
  }

  .site-body .debug-report-entry,
  .site-body .rumor-form-actions {
    align-items: stretch;
    flex-direction: column;
  }

  .site-body .debug-report-entry .button,
  .site-body .rumor-form-actions .button {
    width: 100%;
    justify-content: center;
  }

  .site-body .rumor-form-grid {
    grid-template-columns: minmax(0, 1fr);
  }

  .site-body .rumor-form-grid .wide {
    grid-column: auto;
  }

  .site-body .candidate-donation-dialog {
    width: 100%;
    max-height: calc(100dvh - 24px);
  }

  .site-body .gallery-lightbox {
    width: 100vw;
    height: 100dvh;
    padding: 54px 10px 12px;
  }

  .site-body .pagination {
    min-width: 0;
  }

  .site-body .pagination > div {
    max-width: 100%;
    overflow-x: auto;
    justify-content: flex-start;
  }

  .site-body .footer-inner {
    grid-template-columns: minmax(0, 1fr);
  }

  .site-body .site-footer .brand {
    min-width: 0;
    white-space: normal;
  }

  .site-body .site-footer .brand > span {
    min-width: 0;
  }

  .site-body .footer-links,
  .site-body .footer-transparency-links {
    gap: 10px 16px;
  }

  .maintenance-body .maintenance-page {
    min-height: 100dvh;
  }
}

@media (max-width: 480px) {
  .site-body .container,
  .site-body .footer-inner {
    width: calc(100% - 24px);
  }

  .site-body .header-inner {
    width: calc(100% - 16px);
  }

  .site-body .site-header .brand {
    gap: 5px;
  }

  .site-body .site-header .brand-logo {
    width: 58px;
    height: 38px;
  }

  .site-body .site-header .brand > span {
    max-width: min(46vw, 145px);
    font-size: 11px;
  }

  .site-body .mobile-menu > summary {
    min-width: 44px;
    padding-inline: 8px;
    font-size: 14px;
  }

  .site-body .home-hero {
    padding-inline: 14px;
  }

  .site-body .hero-copy h1 {
    font-size: clamp(37px, 12vw, 52px);
  }

  .site-body .hero-copy > p {
    font-size: 15px;
    line-height: 1.75;
  }

  .site-body .hero-trust {
    max-width: 100%;
    flex-wrap: nowrap;
    overflow-x: auto;
  }

  .site-body .hero-candidate .candidate-portrait {
    height: auto;
    min-height: 0;
    aspect-ratio: 4 / 4.6;
  }

  .site-body .hero-nameplate {
    bottom: 16px;
    padding: 15px 17px;
  }

  .site-body .hero-nameplate strong {
    font-size: 27px;
  }

  .site-body .home-countdown-line {
    flex-wrap: wrap;
    white-space: normal;
    row-gap: 7px;
  }

  .site-body .home-countdown-title {
    flex-basis: 100%;
    margin: 0;
  }

  .site-body .home-schedule-carousel {
    padding-inline: 0;
  }

  .site-body .home-schedule-arrow {
    display: none;
  }

  .site-body .home-schedule-carousel .home-schedule-grid {
    grid-auto-columns: 100%;
  }

  .site-body .home-schedule-section .home-schedule-card,
  .site-body .home-schedule-card {
    grid-template-columns: 72px minmax(0, 1fr);
    gap: 10px;
    padding: 15px 13px;
  }

  .site-body .home-schedule-section .home-schedule-date {
    padding-right: 8px;
  }

  .site-body .home-schedule-section .home-schedule-date strong {
    font-size: 26px;
  }

  .site-body .candidate-carousel-track {
    grid-auto-columns: 88%;
  }

  .site-body .filter-bar {
    grid-template-columns: minmax(0, 1fr);
  }

  .site-body .district-title {
    grid-template-columns: 40px minmax(0, 1fr);
    gap: 12px;
  }

  .site-body .district-title small {
    grid-column: 2;
  }

  .site-body .article-page {
    padding-inline: 8px;
  }

  .site-body .article-shell {
    padding: 24px 15px;
    border-radius: 12px;
  }

  .site-body .article-shell h1,
  .site-body .article-shell h1.article-title-short {
    font-size: clamp(24px, 8vw, 30px);
  }

  .site-body .article-gallery-thumbs {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .site-body .share-bar button,
  .site-body .share-bar .share-network {
    flex-basis: 100%;
  }

  .site-body .profile-facts div,
  .site-body .profile-council-info-panel .profile-facts div,
  .site-body .profile-service-info dl div,
  .site-body .candidate-donation dl > div,
  .site-body .profile-council-info-panel .candidate-donation dl > div {
    grid-template-columns: minmax(0, 1fr);
    gap: 4px;
  }

  .site-body .candidate-socials > div {
    grid-template-columns: minmax(0, 1fr);
  }

  .site-body .profile-council-info-panel {
    padding-inline: 15px;
  }

  .site-body .ballot-number.ballot-number-large {
    flex-basis: 44px;
    width: 44px;
    height: 44px;
    font-size: 22px;
  }

  .site-body .policy-category-group > header {
    display: grid;
    grid-template-columns: minmax(0, 1fr);
    gap: 5px;
  }

  .site-body .policy-accordion summary,
  .site-body .council-policy-theme > summary,
  .site-body .council-policy-subtopic > summary {
    gap: 8px;
    padding: 13px 12px;
  }

  .site-body .policy-accordion-body,
  .site-body .council-policy-theme-body,
  .site-body .council-policy-detail,
  .site-body .council-policy-accordion-content {
    padding: 15px 13px;
  }

  .site-body .public-schedule-preview .timeline-entry,
  .site-body .timeline-entry {
    grid-template-columns: 14px minmax(0, 1fr);
    gap: 9px;
  }

  .site-body .public-schedule-preview .timeline-entry > i,
  .site-body .timeline-entry > i {
    width: 14px;
    height: 14px;
    border-width: 3px;
  }

  .site-body .public-schedule-preview .timeline-card,
  .site-body .timeline-card {
    padding: 17px 14px;
    border-radius: 12px;
  }

  .site-body .timeline-card h3 {
    font-size: 20px;
  }

  .site-body .schedule-map iframe {
    min-height: 230px;
    height: 72vw;
  }

  .site-body .rumor-form-intro,
  .site-body .rumor-form-grid {
    padding: 18px 15px;
  }

  .site-body .rumor-form-actions {
    padding: 0 15px 20px;
  }

  .site-body .rumor-fixed-section {
    padding: 17px 14px;
  }

  .site-body .content-card-tile h2,
  .site-body .home-content-card-grid .content-card-tile h3 {
    font-size: 18px;
  }

  .site-body .pagination .pagination-direction {
    width: auto;
    flex: 1 1 auto;
  }

  .site-body .site-footer {
    padding: 46px 0;
  }

  .site-body .site-footer .brand-logo {
    width: 72px;
    height: 48px;
  }

  .maintenance-body .maintenance-page {
    padding: 16px 10px;
  }

  .maintenance-body .maintenance-card {
    padding: 34px 18px;
  }

  .maintenance-body .maintenance-card h1 {
    font-size: clamp(32px, 10vw, 46px);
  }
}

@media (max-width: 360px) {
  .site-body .site-header .brand > span {
    max-width: 130px;
    font-size: 10.5px;
  }

  .site-body .mobile-menu > summary {
    min-width: 42px;
    font-size: 13px;
  }

  .site-body .eyebrow {
    gap: 9px;
    font-size: 14px;
  }

  .site-body .button {
    gap: 12px;
  }

  .site-body .home-schedule-section .home-schedule-card,
  .site-body .home-schedule-card {
    grid-template-columns: 66px minmax(0, 1fr);
  }

  .site-body .candidate-carousel-track {
    grid-auto-columns: 94%;
  }

  .site-body .update-card-body,
  .site-body .news-list-page .update-card.compact .update-card-body {
    padding: 16px 14px;
  }

  .site-body .page-hero {
    padding-block: 56px 48px;
  }

  .site-body .page-hero h1 {
    font-size: 32px;
  }

  .site-body .article-shell {
    padding-inline: 13px;
  }
}

@media (prefers-reduced-motion: reduce) {
  .site-body *,
  .site-body *::before,
  .site-body *::after,
  .maintenance-body *,
  .maintenance-body *::before,
  .maintenance-body *::after {
    scroll-behavior: auto !important;
    animation-duration: .01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: .01ms !important;
  }
}
