/* ============================================
   國立臺南大學性別培力研究中心 - RWD 響應式
   Mobile First: min-width breakpoints
   ============================================ */

/* ======== min-width: 1025px (桌機) ======== */
/* 沒有左側次選單的頁面（page-layout--full）內容區較寬，圖文式連結改排 4 欄；
   有次選單時維持 style.css 的 3 欄。1024px 以下由下方各斷點接手（2 欄 / 1 欄），
   故此規則限定桌機，避免權重蓋掉手機版。 */
@media (min-width: 1025px) {
  .page-layout--full .link-grid {
    grid-template-columns: repeat(4, 1fr);
  }
}

/* ======== max-width: 1280px ======== */
@media (max-width: 1280px) {
  .hero__slide {
    aspect-ratio: 16 / 6;
  }
}

/* ======== max-width: 1200px (小桌機) ======== */
@media (max-width: 1200px) {
  .nav__link {
    padding: var(--space-4) var(--space-4);
    font-size: var(--text-sm);
  }
}

/* ======== max-width: 1179px ======== */
@media (max-width: 1179px) {
  /* 頁腳：左品牌 + 右選單 3x2 */
  .footer__inner {
    grid-template-columns: 2fr repeat(3, 1fr);
    gap: var(--space-4) var(--space-5);
  }

  .footer__brand {
    grid-row: 1 / 3;
  }

  /* 最新消息 + 行事曆各一行 */
  .home-grid {
    grid-template-columns: 1fr;
    gap: var(--space-16);
  }

  .section__header--left {
    text-align: center;
  }

  .section__header--left .section__title::before,
  .section__header--left .section__title::after {
    content: "";
    display: block;
    width: 32px;
    height: 2px;
    background: var(--text-secondary);
    flex-shrink: 0;
    margin: 0;
  }

  /* 課程卡片 2 欄 + 顯示第 4 張 */
  .course-cards {
    grid-template-columns: repeat(2, 1fr);
  }

  a.course-card.course-card--extra {
    display: block;
  }

  /* 焦點新聞文字區補滿 */
  .news-featured {
    width: 100%;
  }

  .news-featured__body {
    flex: 1;
  }

  /* 漢堡選單 */
  .hamburger {
    display: flex;
  }

  .nav {
    position: fixed;
    top: 0;
    right: -100%;
    width: 300px;
    height: 100vh;
    height: 100dvh;
    background: var(--bg-white);
    box-shadow: -4px 0 20px rgba(0, 0, 0, 0.15);
    z-index: 9999;
    transition: right 0.35s ease;
    overflow-y: auto;
    padding-top: var(--space-16);
  }

  .nav.open {
    right: 0;
  }

  .nav__list {
    flex-direction: column;
    padding: var(--space-4);
    gap: 0;
    margin-bottom: 2rem;
  }

  .nav__link {
    padding: var(--space-4) var(--space-5);
    font-size: var(--text-base);
    border-bottom: 1px solid var(--border-light);
  }

  .nav__link::after {
    display: none;
  }

  .nav__dropdown {
    position: static;
    transform: none;
    opacity: 1;
    visibility: visible;
    box-shadow: none;
    border-radius: 0;
    padding: 0;
    background: var(--bg);
    display: none;
  }

  .nav__dropdown::before {
    display: none;
  }

  .nav__item.open .nav__dropdown {
    display: block;
  }

  .nav__dropdown-link {
    padding-left: var(--space-10);
  }

  .nav-overlay {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.5);
    z-index: 9998;
  }

  .nav-overlay.show {
    display: block;
  }

  .nav__close {
    position: absolute;
    top: var(--space-4);
    right: var(--space-4);
    width: 36px;
    height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: var(--text-xl);
    color: var(--text-secondary);
    border-radius: 50%;
    background: var(--bg);
  }

  /* 隱藏頂部列 */
  .header__top {
    display: none;
  }

  .header {
    top: 0;
    border-top: 3px solid var(--primary);
  }

  .header__main,
  .header--scrolled .header__main {
    padding: var(--space-3) 0 !important;
  }

  .header__logo,
  .header--scrolled .header__logo {
    gap: var(--space-2) !important;
  }

  .header__logo-img,
  .header--scrolled .header__logo-img {
    height: 46px !important;
    transition: none !important;
  }

  .header__logo-img--nutn,
  .header--scrolled .header__logo-img--nutn {
    height: 47px !important;
  }

  .header__logo-text,
  .header--scrolled .header__logo-text {
    font-size: var(--text-xl) !important;
    transition: none !important;
  }

  .header__logo-text small,
  .header--scrolled .header__logo-text small {
    font-size: var(--text-sm) !important;
    transition: none !important;
  }

  .header__logo-divider,
  .header--scrolled .header__logo-divider {
    transition: none !important;
  }

  /* 手機選單：滿版紫底白字 */
  .nav {
    width: 100%;
    background: var(--primary-dark);
    padding: var(--space-18) var(--space-8) var(--space-8);
    display: flex;
    flex-direction: column;
  }

  .nav.open {
    display: flex;
  }

  /* 手機版搜尋框 */
  .nav__mobile-search {
    display: flex;
    position: relative;
    margin-bottom: var(--space-6);
    width: 92%;
  }

  .nav__mobile-search-input {
    width: 100%;
    padding: var(--space-3) var(--space-5);
    padding-right: var(--space-12);
    border: 1.5px solid rgba(255, 255, 255, 0.3);
    border-radius: var(--radius-full);
    background: rgba(255, 255, 255, 0.1);
    color: #fff;
    font-size: var(--text-base);
    font-family: inherit;
  }

  .nav__mobile-search-input::placeholder {
    color: rgba(255, 255, 255, 0.5);
  }

  .nav__mobile-search-input:focus {
    outline: none;
    border-color: rgba(255, 255, 255, 0.6);
    background: rgba(255, 255, 255, 0.15);
  }

  .nav__mobile-search-btn {
    position: absolute;
    right: var(--space-4);
    top: 50%;
    transform: translateY(-50%);
    color: rgba(255, 255, 255, 0.6);
    display: flex;
    align-items: center;
    justify-content: center;
  }

  .nav__mobile-search-btn:hover {
    color: #fff;
  }

  .nav__list {
    flex: 1;
    padding: 0;
    width: 90%;
  }

  .nav__link {
    color: #fff;
    font-size: var(--text-xl);
    font-weight: 700;
    padding: var(--space-3) 0;
    border-bottom: none;
    display: flex;
    align-items: center;
    justify-content: space-between;
  }

  /* 有子選單的項目加 + / - 指示 */
  .nav__link[aria-haspopup="true"]::after {
    content: "+";
    display: inline-block;
    font-size: var(--text-2xl);
    font-weight: 400;
    color: rgba(255, 255, 255, 0.6);
    margin-left: var(--space-3);
    transition: transform 0.2s ease;
    width: auto;
    height: auto;
    background: none;
    position: static;
  }

  .nav__item.open > .nav__link[aria-haspopup="true"]::after {
    content: "−";
  }

  .nav__link:hover {
    color: rgba(255, 255, 255, 0.8);
  }

  .nav .nav__dropdown {
    background: transparent !important;
    position: static !important;
    transform: none !important;
    left: auto !important;
    top: auto !important;
    width: 100% !important;
    min-width: 0 !important;
    max-width: 100% !important;
    border-radius: 0 !important;
    box-shadow: none !important;
    margin: 0 !important;
    padding: 0 0 var(--space-2) !important;
    opacity: 1 !important;
    visibility: visible !important;
  }

  .nav .nav__dropdown-link {
    color: rgba(255, 255, 255, 0.75) !important;
    padding: 0.35rem var(--space-5) !important;
    font-size: var(--text-lg) !important;
    font-weight: 400 !important;
    border-bottom: none !important;
    white-space: normal !important;
    display: block !important;
  }

  .nav .nav__dropdown-link:hover {
    background: rgba(255, 255, 255, 0.08) !important;
    color: #fff !important;
  }

  .nav__close {
    background: rgba(255, 255, 255, 0.15);
    color: #fff;
    top: var(--space-3);
    right: var(--space-3);
    width: 40px;
    height: 40px;
    font-size: var(--text-2xl);
  }

  .nav__close:hover {
    background: rgba(255, 255, 255, 0.25);
    color: #fff;
  }

  /* 手機版快捷連結 */
  .nav__mobile-links {
    display: flex;
    justify-content: center;
    gap: var(--space-5);
    padding: var(--space-6) var(--space-4);
    border-top: 1px solid rgba(255, 255, 255, 0.15);
    margin: auto calc(var(--space-4) * -1) 0;
    width: calc(100% + var(--space-4) * 2);
  }

  .nav__mobile-link {
    display: inline-flex;
    align-items: center;
    gap: var(--space-1);
    color: rgba(255, 255, 255, 0.6);
    font-size: var(--text-base);
    font-weight: 500;
  }

  .nav__mobile-link:hover {
    color: #fff;
  }
}


/* ======== max-width: 1024px (平板橫向) ======== */
@media (max-width: 1024px) {
  .home-grid {
    grid-template-columns: 1fr;
  }

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

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

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

  .page-layout {
    grid-template-columns: 1fr;
  }

  .sidebar {
    position: static;
    order: 2;
  }

  .page-content {
    order: 1;
  }

  .hero__slide {
    aspect-ratio: 16 / 6;
  }

  .hero__slide-title {
    font-size: var(--text-3xl);
  }

  .header__logo-text {
    font-size: var(--text-xl);
  }

  .header__logo-text small {
    font-size: var(--text-xs);
  }

  .section--alt {
    padding: var(--space-10) 0 var(--space-20);
  }
}

/* ======== max-width: 768px (平板直向) ======== */
@media (max-width: 768px) {

  #main-content {
    background: linear-gradient(180deg, #f5f5f5 0%, #fff 30%);
  }

  .page-workshop-detail-3 .course-card__tag {
    margin-top: var(--space-0);
  }

  .article-header__date {
    margin-top: .5rem;
    margin-bottom:.3rem;
  }

  .workshop-detail__header .article-share {
    position: static;
    margin-top: var(--space-3);
  }

  .workshop-detail__meta {
    margin-top: .5rem;
  }

  .workshop-detail__info-item {
    gap: var(--space-1);
  }

  .course-card__date {
    font-size: var(--text-sm);
  }

  .workshop-detail__info {
    padding: var(--space-5) var(--space-4);
  }

  /* Hero */
  .hero__slide {
    aspect-ratio: 4 / 3;
  }

  .hero__slide-content {
    padding: var(--space-8) var(--space-6) var(--space-32);
  }

  .hero__slide-title {
    font-size: var(--text-2xl);
  }

  .hero__slide-desc {
    font-size: var(--text-base);
  }

  .hero__arrow {
    width: 36px;
    height: 36px;
    font-size: var(--text-base);
  }

  /* Section */
  .section {
    padding: var(--space-12) 0;
  }

  .section__title {
    font-size: var(--text-2xl);
  }

  .section__header {
    margin-bottom: var(--space-4);
  }

  /* 內頁 */
  .page-layout {
    grid-template-columns: 1fr;
    padding: var(--space-3) var(--space-2) var(--space-14);
  }

  .sidebar {
    position: static;
    order: 2;
  }

  .page-content {
    order: 1;
  }

  .page-banner__title {
    font-size: var(--text-2xl);
  }

  /* Profile */
  .profile-card {
    flex-direction: column;
    align-items: center;
    text-align: center;
    padding: var(--space-8);
  }

  .profile-card__photo {
    width: 160px;
    height: 210px;
  }

  .profile-card__section ul {
    text-align: left;
  }

  /* 焦點新聞 RWD */
  .news-featured {
    flex-direction: column;
  }

  .news-featured__img {
    width: 100%;
    height: auto;
    aspect-ratio: 16 / 9;
  }

  .news-featured__body {
    padding: var(--space-4);
  }

  /* 課程卡片：手機 1 欄 3 則 */
  .course-cards {
    grid-template-columns: 1fr;
  }

  a.course-card.course-card--extra {
    display: none;
  }

  /* Gallery */
  .gallery-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: var(--space-4);
  }

  /* 影音 */
  .video-grid {
    grid-template-columns: 1fr;
  }

  /* Footer */
  .footer__inner {
    grid-template-columns: 2.5fr repeat(3, 1fr);
    gap: var(--space-3);
    text-align: left;
  }

  .footer__brand {
    grid-row: 1 / 3;
    gap: var(--space-2);
  }

  .footer__badge {
    margin-left: 0;
    margin-right: auto;
  }


  /* 流程 */
  .process-steps {
    flex-direction: column;
    align-items: center;
  }

  .process-step__arrow {
    display: none;
  }

  /* News */
  .news-item {
    flex-wrap: wrap;
    gap: var(--space-2);
  }

  .news-item__date {
    min-width: auto;
  }

  /* Link grid */
  .link-grid {
    grid-template-columns: 1fr 1fr;
  }
}

/* ======== max-width: 767px (手機) ======== */
@media (max-width:767px) {
  .container {
    padding: 0 var(--space-4);
  }

  .footer__inner {
    grid-template-columns: repeat(3, 1fr);
    text-align: center;
    gap: var(--space-3);
  }

  .footer__brand {
    grid-column: 1 / -1;
    grid-row: auto;
    margin-bottom: 2rem;
  }

  .footer__info {
    align-items: center;
  }

  .footer__badge {
    margin-left: auto;
    margin-right: auto;
  }

  /* 焦點新聞與列表分隔線 */
  .news-featured {
    margin-bottom: var(--space-2);
  }

  .news-list {
    border-top: 1px solid var(--border);
    padding-top: 0;
  }

  /* 消息列表：日期+標籤同行，標題換行 */
  .news-item {
    flex-wrap: wrap;
    align-items: center;
    gap: var(--space-1);
    padding: var(--space-3) var(--space-3);
  }

  .news-item__date {
    font-size: var(--text-sm);
    min-width: auto;
  }

  .news-item__title {
    flex-basis: 100%;
    font-size: var(--text-base);
    line-height: 1.6;
  }

  /* news.html 消息列表：日期+標籤同行，標題換行 */
  .news-page__item {
    flex-wrap: wrap;
    align-items: center;
    gap: var(--space-1);
    padding-left: 0;
    padding-right: 0;
  }

  .news-page__item .news-page__date {
    min-width: auto;
  }

  .news-page__item .news-page__title {
    flex-basis: 100%;
    line-height: 1.6;
  }

  /* btn 箭頭空間 */
  .btn--arrow {
    padding-right: calc(var(--space-6) + 24px);
  }

  .btn--arrow::after {
    right: var(--space-4);
  }

  /* 隱藏頁籤，顯示自訂下拉選單 */
  .news-tabs {
    display: none;
  }

  .news-dropdown {
    display: block;
    position: relative;
    margin-bottom: var(--space-4);
  }

  /* Header */
  .header__logo-text {
    font-size: var(--text-lg);
  }

  .header__logo-text small {
    font-size: var(--text-xs);
  }

  .header__logo-img {
    height: 40px;
  }
  .header__logo-img--nutn{
    margin-right: .2rem;
  }
  .header__logo-divider {
    height: 28px;
  }

  /* scrolled 時也維持一樣 */
  .header--scrolled .header__main {
    padding: var(--space-3) 0;
  }

  .header--scrolled .header__logo-text {
    font-size: var(--text-lg);
  }

  .header--scrolled .header__logo-text small {
    font-size: var(--text-xs);
  }

  .header--scrolled .header__logo-img {
    height: 40px;
  }

  .header__top-inner {
    justify-content: center;
    font-size: var(--text-xs);
  }

  /* Hero */
  .hero__slide {
    aspect-ratio: 3 / 4;
    align-items: flex-end;
  }

  .hero__slide::before {
    background: linear-gradient(to top, rgba(62, 20, 80, 0.95) 0%, rgba(62, 20, 80, 0.35) 60%);
  }

  .hero__slide-content {
    padding: var(--space-8) var(--space-5) var(--space-40);
  }

  .hero__slide-title {
    font-size: var(--text-3xl);
  }

  .hero__slide-desc {
    font-size: var(--text-md);
    margin-bottom: var(--space-5);
    font-weight: 500;
  }

  .hero__controls {
    bottom: var(--space-5);
  }

  .hero__arrow {
    display: none;
  }

  /* Section */
  .section {
    padding: var(--space-10) 0;
  }

  .section__subtitle-en {
    font-size: var(--text-4xl);
    margin-bottom: 0;
    font-weight: 800;
  }

.section--alt {
  padding: var(--space-5) 0 var(--space-12);
}
  .section__title {
    font-size: var(--text-xl);
  }

  .section__header .section__title {
    margin-bottom: var(--space-5);
  }

.section--gradient {
  padding-top: var(--space-14);
  padding-bottom:var(--space-16);
  background: linear-gradient(135deg, var(--primary-light) 70%, var(--secondary-light));
}
  .section__header {
    margin-bottom: var(--space-0);
  }
  .section--gradient .section__header {
    padding-bottom: var(--space-0);
  }

  .news-more--lg {
    margin-top: var(--space-8);
  }

  /* 卡片 */
  .gallery-grid {
    grid-template-columns: 1fr;
  }

  .link-grid {
    grid-template-columns: 1fr;
  }

  .team-grid {
    grid-template-columns: 1fr;
  }

  .download-grid {
    grid-template-columns: 1fr;
  }

  /* 日曆 */
  .calendar__header {
    padding: var(--space-3) var(--space-4);
    flex-wrap: nowrap;
  }

  .cal-picker__trigger {
    font-size: var(--text-lg);
    white-space: nowrap;
  }

  .calendar__title {
    font-size: var(--text-base);
  }

  .calendar__nav-btn {
    width: 28px;
    height: 28px;
  }

  .calendar__day {
    min-height: 60px;
    padding: 2px;
  }

  .calendar__day-num {
    width: 22px;
    height: 22px;
    font-size: var(--text-xs);
  }

  .calendar__weekday {
    padding: var(--space-1);
    font-size: var(--text-xs);
  }

  .calendar__event-bar {
    font-size: 9px;
    padding: 1px 3px;
  }

  .cal-popup__content {
    width: 280px;
  }

  /* Profile */
  .profile-card {
    padding: var(--space-0);
    gap: var(--space-6);
  }

  .profile-card__photo {
    width: 270px;
    height: auto;
  }

  .profile-card__name {
    font-size: var(--text-xl);
  }

  .page-content .profile-card__heading {
    font-size: var(--text-xl);
  }

  .page-content .career-list__item {
    display: inline-block;
  }

  .text-gradient-bar {
    font-size: 1.1rem !important;
  }

  .director-slogan img {
    margin: 0 auto;
  }

  .back-to-list {
    margin-top: var(--space-8);
  }

  .event-grid {
    grid-template-columns: 1fr;
  }

  .container > .page-content {
    max-width: 100%;
    padding: var(--space-6) var(--space-2) var(--space-14);
  }

  /* 文章詳細頁 */
  .article-header .article-share {
    position: static;
    margin-bottom: var(--space-3);
  }

  .page-content .article-header__title {
    text-align: left;
    margin-top: 0rem;
  }

  .page-content .article-header__title::after {
    left: 0;
    transform: none;
  }

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

  .law-item--download {
    flex-wrap: nowrap;
    gap: var(--space-2);
    padding: var(--space-3) var(--space-3);
  }

  .law-item {
    flex-wrap: nowrap;
    gap: var(--space-2);
    padding: var(--space-3) var(--space-3);
  }

  .law-item:has(.law-list--sub) {
    flex-wrap: wrap;
  }

  .law-list--sub {
    margin-left: var(--space-8);
  }

  .law-item__icon {
    width: 32px;
    height: 32px;
  }

  .law-item__icon .icon--base {
    width: 16px;
    height: 16px;
  }

  .law-item__formats {
    flex-direction: column;
  }

  .law-item__btn {
    padding: .1rem var(--space-3);
  }

  .intro-logo img {
    margin: 0 auto;
    display: block;
  }

  .media-tabs {
    display: none;
  }

  .media-dropdown {
    display: block;
  }

  /* Page banner */
  .page-banner {
    padding: var(--space-18) 0;
  }

  .page-banner__title {
    font-size: var(--text-2xl);
  }

  /* Breadcrumb */
  .breadcrumb {
    display: none;
  }

  /* Footer */
  .footer {
    padding-top: var(--space-8);
  }

  .footer__heading {
    font-size: var(--text-md);
        padding-bottom: var(--space-3);
        line-height: 1.7;
  }

  /* Button */
  .btn {
    padding: var(--space-3) var(--space-10) var(--space-3) var(--space-6);
    font-size: var(--text-md);
  }

  /* Content */
  .page-content h2 {
    font-size: 1.6rem;
    text-align: center;
    margin-bottom: var(--space-8);
  }

  .page-content h2::after {
    left: 50%;
    transform: translateX(-50%);
  }

  .page-content .workshop-detail__title {
    text-align: left;
  }

  .page-content .workshop-detail__title::after {
    left: 0;
    transform: none;
  }

  .page-content h3 {
    font-size: var(--text-lg);
  }
}

@media (max-width:580px) {
  .hero__slide-content {
    padding: var(--space-8) var(--space-5) var(--space-26);
  }
  .header__logo-img,
  .header--scrolled .header__logo-img {
    height: 36px !important;
  }

  .header__logo-img--nutn,
  .header--scrolled .header__logo-img--nutn {
    height: 38px !important;
  }

  .header__logo-text,
  .header--scrolled .header__logo-text {
    font-size: 1.125rem!important;
  }
}

@media (max-width: 360px) {
  .header__logo-img,
  .header--scrolled .header__logo-img {
    height: 34px !important;
  }

  .header__logo-img--nutn,
  .header--scrolled .header__logo-img--nutn {
    height: 35px !important;
  }

  .header__logo-text,
  .header--scrolled .header__logo-text {
    font-size: 1.0625rem!important;
  }

  .header__logo-text small,
  .header--scrolled .header__logo-text small {
    font-size: var(--text-xs) !important;
  }

  .header__logo,
  .header--scrolled .header__logo {
    gap: var(--space-2) !important;
  }
}