/*
Theme Name: FEFYL
Theme URI: https://fefyl.com
Author: Far East Freedom Youth League
Description: The Far East Freedom Youth League site, ported from the original static design. Content is edited in WordPress; layout lives here.
Version: 1.0.0
Requires at least: 6.5
Requires PHP: 8.1
License: GNU General Public License v2 or later
Text Domain: fefyl
*/

:root {
  --ink: #10151f;
  --navy: #1f3467;
  --slate: #505d89;
  --sky: #98b7d8;
  --sand: #dfbf99;
  --sand-deep: #ad845f;
  --paper: #f6f7f8;
  --muted: #687184;
  --white: #ffffff;
  --line: rgba(31, 52, 103, 0.16);
  --shadow: 0 24px 70px rgba(18, 28, 55, 0.16);
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  color: var(--ink);
  background: var(--paper);
  font-family: "Inter", Arial, sans-serif;
  line-height: 1.5;
}

img {
  display: block;
  max-width: 100%;
}

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

.site-shell {
  overflow: hidden;
}

.nav {
  position: fixed;
  z-index: 20;
  top: 0;
  left: 0;
  right: 0;
  border-bottom: 1px solid rgba(255, 255, 255, 0.16);
  background: rgba(16, 21, 31, 0.82);
  backdrop-filter: blur(16px);
}

.nav-inner {
  width: min(1180px, calc(100% - 32px));
  min-height: 72px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
}

.brand {
  display: flex;
  align-items: center;
  gap: 12px;
  min-width: 210px;
  color: var(--white);
  font-weight: 800;
  letter-spacing: 0;
  line-height: 1.05;
}

.brand img {
  width: 44px;
  height: 44px;
  object-fit: contain;
}

.nav-links {
  display: flex;
  align-items: center;
  gap: 16px;
  color: rgba(255, 255, 255, 0.88);
  font-size: 0.91rem;
  font-weight: 700;
}

/* 連結永不折行（加了 Works and Materials 之後 22px 間距塞不下，縮成 16px） */
.nav-links a {
  border-bottom: 2px solid transparent;
  padding: 6px 0;
  white-space: nowrap;
}

@media (max-width: 1212px) {
  .nav-links {
    gap: 12px;
    font-size: 0.86rem;
  }
}

@media (max-width: 1100px) {
  .brand {
    min-width: 0;
  }

  .brand span {
    display: none;
  }
}

.nav-links a:hover {
  border-color: var(--sand);
  color: var(--white);
}

.language-switcher {
  position: relative;
  flex: 0 0 auto;
}

.language-button,
.language-menu button {
  display: flex;
  align-items: center;
  gap: 10px;
  border: 0;
  border-radius: 4px;
  background: transparent;
  color: var(--white);
  font: inherit;
  font-size: 0.92rem;
  font-weight: 300;
  letter-spacing: 0;
  cursor: pointer;
}

.language-button {
  min-height: 40px;
  padding: 0;
}

.language-button:hover,
.language-button[aria-expanded="true"] {
  color: var(--sand);
}

.language-flag {
  width: 28px;
  height: 18px;
  flex: 0 0 auto;
  border-radius: 2px;
  box-shadow: 0 0 0 1px rgba(255, 255, 255, 0.35);
  object-fit: cover;
}

.language-chevron {
  width: 10px;
  height: 10px;
  margin-left: 4px;
  border-right: 2px solid currentColor;
  border-bottom: 2px solid currentColor;
  transform: rotate(45deg) translateY(-2px);
}

.language-menu {
  position: absolute;
  z-index: 30;
  top: calc(100% + 10px);
  right: 0;
  width: 210px;
  max-height: min(420px, calc(100vh - 96px));
  overflow: auto;
  padding: 8px;
  border: 1px solid rgba(255, 255, 255, 0.16);
  border-radius: 6px;
  background: rgba(16, 21, 31, 0.98);
  box-shadow: 0 18px 48px rgba(0, 0, 0, 0.28);
}

.language-menu[hidden] {
  display: none;
}

.language-menu button {
  width: 100%;
  justify-content: flex-start;
  padding: 10px;
  background: transparent;
}

.language-menu button:hover,
.language-menu button[aria-selected="true"] {
  background: rgba(255, 255, 255, 0.1);
}

.language-menu button[aria-selected="true"] {
  color: var(--sand);
}

.language-menu button span {
  font-weight: 300;
}

.language-menu .language-flag {
  box-shadow: 0 0 0 1px rgba(255, 255, 255, 0.22);
}

.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
}

.hero {
  position: relative;
  min-height: min(92vh, 1000px);
  min-height: min(92svh, 1000px);
  display: grid;
  align-items: end;
  color: var(--white);
  background-color: #dfe7ec;
  background-image:
    linear-gradient(180deg, rgba(9, 15, 32, 0.16), rgba(9, 15, 32, 0.9)),
    url("assets/images/flags.jpg");
  background-position:
    center,
    center top;
  background-repeat: no-repeat;
  background-size:
    cover,
    100% auto;
}

.hero::after {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  bottom: -1px;
  height: 120px;
  background: linear-gradient(180deg, transparent, var(--paper));
}

.hero-inner {
  position: relative;
  z-index: 1;
  width: min(1180px, calc(100% - 32px));
  margin: 0 auto;
  padding: 150px 0 112px;
}

.hero-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 330px;
  gap: 56px;
  align-items: end;
}

.eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 20px;
  color: var(--sand);
  font-weight: 900;
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

.eyebrow::before {
  content: "";
  width: 42px;
  height: 3px;
  background: var(--sand);
}

h1,
h2,
h3,
p {
  margin-top: 0;
}

h1 {
  max-width: 760px;
  margin-bottom: 22px;
  font-size: clamp(2.8rem, 7vw, 6rem);
  line-height: 0.94;
  font-weight: 900;
  letter-spacing: 0;
  text-transform: uppercase;
}

.hero-copy {
  max-width: 690px;
  margin-bottom: 34px;
  color: rgba(255, 255, 255, 0.88);
  font-size: clamp(1.05rem, 1.8vw, 1.28rem);
}

.hero-actions,
.section-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
}

.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 48px;
  padding: 0 20px;
  border: 2px solid transparent;
  border-radius: 4px;
  font-weight: 900;
  text-transform: uppercase;
}

.button.primary {
  background: var(--sand);
  color: var(--navy);
}

.button.secondary {
  border-color: rgba(255, 255, 255, 0.44);
  color: var(--white);
}

.seal-card {
  position: relative;
  padding: 30px;
  background: rgba(31, 52, 103, 0.88);
  box-shadow: var(--shadow);
}

.seal-card img {
  width: 100%;
  margin: 18px auto 0;
  border-radius: 50%;
}

.seal-card strong {
  display: block;
  color: var(--sand);
  font-size: 1.05rem;
  font-weight: 900;
  text-transform: uppercase;
}

.section {
  padding: 96px 0;
}

.container {
  width: min(1180px, calc(100% - 32px));
  margin: 0 auto;
}

.section-header {
  display: grid;
  grid-template-columns: minmax(0, 0.75fr) minmax(280px, 1fr);
  gap: 56px;
  align-items: end;
  margin-bottom: 48px;
}

.about-header {
  grid-template-columns: 1fr;
  gap: 24px;
  align-items: start;
}

.about-header h2 {
  max-width: 820px;
  font-size: clamp(2.35rem, 5vw, 4.6rem);
  line-height: 1;
}

.about-header .lead {
  max-width: 760px;
  margin-left: auto;
}

.kicker {
  color: var(--sand-deep);
  font-weight: 900;
  text-transform: uppercase;
}

h2 {
  margin-bottom: 0;
  color: var(--navy);
  font-size: clamp(2.2rem, 5vw, 5rem);
  line-height: 0.98;
  font-weight: 900;
  letter-spacing: 0;
  text-transform: uppercase;
}

h3 {
  color: var(--navy);
  font-size: 1.4rem;
  line-height: 1.12;
  font-weight: 900;
}

.lead {
  margin-bottom: 0;
  color: var(--muted);
  font-size: 1.12rem;
}

.intro-grid {
  display: grid;
  grid-template-columns: 1.04fr 0.96fr;
  gap: 28px;
  align-items: stretch;
}

.intro-panel {
  min-height: 560px;
  display: grid;
  grid-template-rows: auto 1fr;
  overflow: hidden;
  background: var(--white);
  box-shadow: var(--shadow);
}

.statue-panel {
  position: relative;
  display: flex;
  align-items: end;
  justify-content: center;
  min-height: 320px;
  padding: 8px 24px 0;
  background: #eceeef;
}

.statue-panel img {
  width: min(680px, 100%);
  height: auto;
}

.intro-copy {
  display: grid;
  align-content: start;
  padding: 42px 48px 34px;
}

.intro-copy p {
  color: var(--sand-deep);
  font-size: 1.14rem;
  font-weight: 600;
}

.work-panel {
  display: grid;
  align-content: center;
  padding: 52px;
  background: var(--sky);
}

.work-panel h3 {
  color: var(--white);
  font-size: clamp(2rem, 3vw, 3rem);
}

.work-panel p {
  margin-bottom: 0;
  max-width: 520px;
  font-size: 1.08rem;
}

.identity-panel {
  display: grid;
  align-content: space-between;
  min-height: 560px;
  padding: 40px;
  background: var(--slate);
  color: var(--white);
}

.identity-panel h2 {
  color: var(--white);
  text-align: right;
}

.identity-panel h2 span {
  color: var(--sand);
}

.identity-panel img {
  width: min(330px, 82%);
  margin: 0 auto;
  border-radius: 50%;
}

.ribbon {
  justify-self: end;
  min-width: min(450px, 100%);
  padding: 22px 28px;
  background: var(--sand);
  color: var(--ink);
  text-align: center;
  font-weight: 800;
  text-transform: uppercase;
}

.navy-band {
  background: var(--navy);
  color: var(--white);
}

.navy-band h2,
.navy-band h3 {
  color: var(--white);
}

.navy-band .lead,
.navy-band p {
  color: rgba(255, 255, 255, 0.82);
}

.principles {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 1px;
  background: rgba(255, 255, 255, 0.16);
}

.principle {
  min-height: 255px;
  padding: 32px;
  background: rgba(255, 255, 255, 0.06);
}

.principle .number {
  color: var(--sand);
  font-size: 0.9rem;
  font-weight: 900;
}

.independence-heading {
  max-width: 980px;
  margin-bottom: 42px;
}

.independence-heading .lead {
  max-width: 720px;
  margin-top: 18px;
}

.feature-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(360px, 0.88fr);
  gap: 34px;
  align-items: start;
}

.text-stack {
  display: grid;
  gap: 22px;
}

.text-card {
  padding: 30px;
  border-left: 7px solid var(--sand);
  background: var(--white);
  box-shadow: 0 12px 40px rgba(18, 28, 55, 0.08);
}

.image-frame {
  margin: 0;
  background: var(--white);
  box-shadow: var(--shadow);
}

.image-open {
  display: block;
  width: 100%;
  border: 0;
  padding: 0;
  background: transparent;
  cursor: zoom-in;
  font: inherit;
}

.image-frame .image-open {
  padding: 24px;
  background: #eceeef;
}

.image-frame img {
  width: 100%;
  height: auto;
  object-fit: contain;
}

.independence-media {
  display: grid;
  gap: 22px;
}

.independence-media .image-frame:first-child .image-open {
  background: var(--white);
}

.secondary-media img {
  max-height: 420px;
}

.map-layout {
  display: grid;
  grid-template-columns: minmax(0, 0.88fr) minmax(0, 1.12fr);
  gap: 34px;
  align-items: center;
}

.map-card {
  margin: 0;
  overflow: hidden;
  background: #e9eaec;
  box-shadow: var(--shadow);
}

.map-title {
  display: inline-block;
  padding: 18px 28px;
  background: var(--sand);
  color: var(--white);
  font-size: 1.4rem;
  font-weight: 900;
  text-transform: uppercase;
}

.map-card .carousel-track {
  padding: 24px;
}

.map-card img {
  width: 100%;
  height: auto;
  max-height: 620px;
  object-fit: contain;
}

.map-card .carousel-controls {
  opacity: 0;
  pointer-events: none;
  transform: translateY(8px);
}

.map-card .carousel:hover .carousel-controls,
.map-card .carousel:focus-within .carousel-controls {
  opacity: 1;
  pointer-events: auto;
  transform: translateY(0);
}

.map-copy-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 22px;
  margin-top: 34px;
}

.publications {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 22px;
}

.publication {
  display: grid;
  grid-template-rows: 330px auto;
  overflow: hidden;
  background: var(--white);
  box-shadow: 0 12px 40px rgba(18, 28, 55, 0.08);
}

.publication > .image-open,
.publication .carousel {
  align-self: stretch;
  height: 100%;
  min-height: 0;
}

.publication img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.carousel {
  position: relative;
  display: block;
  min-width: 0;
  overflow: hidden;
}

.carousel-track {
  display: grid;
  height: 100%;
  min-width: 0;
}

.carousel-slide {
  grid-area: 1 / 1;
  height: 100%;
}

.carousel-slide[hidden] {
  display: none;
}

.carousel-controls {
  position: absolute;
  left: 12px;
  right: 12px;
  bottom: 12px;
  z-index: 2;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 12px;
  border-radius: 4px;
  background: rgba(246, 247, 248, 0.92);
  color: var(--navy);
  font-size: 0.78rem;
  font-weight: 900;
  text-transform: uppercase;
  opacity: 0;
  pointer-events: none;
  transform: translateY(8px);
  transition:
    opacity 180ms ease,
    transform 180ms ease;
}

.carousel:hover .carousel-controls,
.carousel:focus-within .carousel-controls {
  opacity: 1;
  pointer-events: auto;
  transform: translateY(0);
}

.carousel-controls button {
  border: 0;
  border-radius: 4px;
  padding: 8px 10px;
  background: var(--navy);
  color: var(--white);
  cursor: pointer;
  font: inherit;
}

.carousel-controls button.is-active {
  background: var(--sand);
  color: var(--navy);
}

.carousel-toggle {
  justify-content: stretch;
}

.carousel-toggle button {
  flex: 1;
}

.navy-band .carousel-controls {
  background: rgba(246, 247, 248, 0.92);
  color: var(--navy);
}

.navy-band .carousel-controls button {
  background: var(--sand);
  color: var(--navy);
}

.publication-body {
  padding: 28px;
}

.publication-body h3 {
  color: var(--navy);
}

.publication-body p {
  color: var(--muted);
}

.contact {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(320px, 0.72fr);
  gap: 34px;
  align-items: stretch;
}

.contact-card {
  display: grid;
  align-content: center;
  padding: 38px;
  background: var(--navy);
  color: var(--white);
}

.contact-card h2 {
  color: var(--white);
  font-size: clamp(2.3rem, 5vw, 4.8rem);
}

.email-card {
  display: grid;
  gap: 8px;
  margin-top: 34px;
  padding: 24px;
  border: 2px solid rgba(223, 191, 153, 0.8);
  border-radius: 4px;
  background: rgba(255, 255, 255, 0.08);
}

.email-card span {
  color: var(--sand);
  font-size: 0.88rem;
  font-weight: 900;
  text-transform: uppercase;
}

.email-card strong {
  color: var(--white);
  font-size: clamp(1.3rem, 3vw, 2.4rem);
  line-height: 1.1;
  word-break: break-word;
}

.email-card:hover {
  background: rgba(223, 191, 153, 0.14);
}

.contact-socials {
  padding: 38px;
  background: var(--white);
  box-shadow: var(--shadow);
}

.contact-socials h3 {
  margin-bottom: 0;
}

.contact-list {
  display: grid;
  gap: 22px;
  margin-top: 32px;
}

.contact-item span {
  display: block;
  color: var(--sand);
  font-weight: 900;
}

.contact-item a {
  color: inherit;
  text-decoration: underline;
  text-decoration-color: rgba(223, 191, 153, 0.78);
  text-underline-offset: 4px;
}

.contact-item a:hover {
  color: var(--navy);
}

.footer {
  padding: 112px 0 48px;
  background: #020417;
  color: rgba(255, 255, 255, 0.72);
}

.footer-inner {
  width: min(1180px, calc(100% - 32px));
  margin: 0 auto;
  display: grid;
  justify-items: center;
  gap: 36px;
}

.footer-logo img {
  width: 120px;
  height: auto;
}

.footer-nav {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  gap: 16px;
  color: rgba(255, 255, 255, 0.82);
  font-weight: 700;
}

.footer-nav a {
  display: inline-flex;
  align-items: center;
  gap: 16px;
}

.footer-nav a:not(:last-child)::after {
  content: "";
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--sand);
}

.footer-nav a:hover,
.footer-legal a:hover {
  color: var(--sand);
}

.footer-socials {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 12px;
}

.footer-socials a {
  display: grid;
  place-items: center;
  width: 48px;
  height: 48px;
  border: 2px solid rgba(255, 255, 255, 0.74);
  border-radius: 50%;
  color: var(--white);
}

.footer-socials a:hover {
  border-color: var(--sand);
  color: var(--sand);
}

.footer-socials svg {
  width: 24px;
  height: 24px;
  fill: currentColor;
}

.footer-bottom {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  border-top: 1px solid rgba(255, 255, 255, 0.14);
  padding-top: 34px;
}

.footer-legal {
  display: flex;
  align-items: center;
  gap: 16px;
}

.site-version {
  color: rgba(255, 255, 255, 0.52);
  font-size: 0.9rem;
}

.footer-legal a::before {
  content: "";
  display: inline-block;
  width: 4px;
  height: 4px;
  margin-right: 16px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.72);
  vertical-align: middle;
}

.legal-page {
  width: min(860px, calc(100% - 32px));
  margin: 0 auto;
  padding: 96px 0;
}

.legal-page h1 {
  color: var(--navy);
  font-size: clamp(2.8rem, 7vw, 5.5rem);
}

.legal-page p {
  color: var(--muted);
  font-size: 1.08rem;
}

.legal-back {
  display: inline-block;
  margin-bottom: 32px;
  color: var(--sand-deep);
  font-weight: 900;
  text-transform: uppercase;
}

.lightbox {
  position: fixed;
  z-index: 40;
  inset: 0;
  display: grid;
  place-items: center;
  padding: 72px 24px 24px;
  background: rgba(8, 12, 24, 0.9);
}

.lightbox[hidden] {
  display: none;
}

.lightbox img {
  max-width: min(100%, 1400px);
  max-height: 86vh;
  object-fit: contain;
  box-shadow: 0 24px 80px rgba(0, 0, 0, 0.4);
}

.lightbox-nav {
  position: absolute;
  top: 50%;
  z-index: 2;
  display: grid;
  place-items: center;
  width: 54px;
  height: 72px;
  border: 0;
  border-radius: 4px;
  background: rgba(246, 247, 248, 0.9);
  color: var(--navy);
  cursor: pointer;
  font: inherit;
  font-size: 3rem;
  font-weight: 900;
  line-height: 1;
  transform: translateY(-50%);
}

.lightbox-nav[hidden] {
  display: none;
}

.lightbox-nav:hover,
.lightbox-nav:focus-visible {
  background: var(--sand);
}

.lightbox-nav-previous {
  left: 24px;
}

.lightbox-nav-next {
  right: 24px;
}

.lightbox-close {
  position: absolute;
  top: 20px;
  right: 20px;
  border: 0;
  border-radius: 4px;
  padding: 10px 14px;
  background: var(--sand);
  color: var(--navy);
  cursor: pointer;
  font: inherit;
  font-weight: 900;
  text-transform: uppercase;
}

@media (max-width: 920px) {
  .nav-inner {
    align-items: flex-start;
    min-height: auto;
    padding: 16px 0;
  }

  .nav-links {
    display: none;
  }

  .hero-grid,
  .section-header,
  .intro-grid,
  .feature-grid,
  .map-layout,
  .map-copy-grid,
  .contact {
    grid-template-columns: 1fr;
  }

  .seal-card {
    max-width: 330px;
  }

  .principles,
  .publications {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .lightbox {
    padding-inline: 72px;
  }

  .lightbox-nav {
    width: 44px;
    height: 64px;
    font-size: 2.4rem;
  }
}

@media (max-width: 1180px) {
  .hero {
    background-size:
      cover,
      auto clamp(360px, 52vh, 720px);
  }
}

@media (max-width: 680px) {
  .hero-inner {
    padding-bottom: 74px;
  }

  .section {
    padding: 68px 0;
  }

  .intro-panel,
  .principles,
  .publications {
    grid-template-columns: 1fr;
  }

  .intro-panel {
    min-height: auto;
  }

  .statue-panel {
    min-height: 430px;
  }

  .intro-copy,
  .work-panel,
  .identity-panel,
  .contact-card,
  .contact-socials {
    padding: 28px;
  }

  .publication {
    grid-template-rows: 260px auto;
  }

  .lightbox {
    padding-inline: 52px;
  }

  .lightbox-nav {
    width: 36px;
    height: 54px;
    font-size: 2rem;
  }

  .lightbox-nav-previous {
    left: 8px;
  }

  .lightbox-nav-next {
    right: 8px;
  }

  .footer {
    padding: 72px 0 34px;
  }

  .footer-bottom {
    align-items: center;
    flex-direction: column;
    text-align: center;
  }

  .footer-nav {
    gap: 12px;
  }

  .footer-nav a {
    gap: 12px;
  }
}

/* ---------- WordPress 補充：原站之外最小必要，不改原版式 ---------- */

body.admin-bar .nav {
  top: 32px;
}

@media (max-width: 782px) {
  body.admin-bar .nav {
    top: 46px;
  }
}

@media (max-width: 600px) {
  body.admin-bar .nav {
    top: 0;
  }
}

.screen-reader-text {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(1px, 1px, 1px, 1px);
  clip-path: inset(50%);
  margin: -1px;
  padding: 0;
  border: 0;
  white-space: nowrap;
}

/* 地圖卡只有一張圖時沒有 carousel-track，補回原本的內距 */
.map-card > .image-open {
  padding: 24px;
  background: transparent;
}

/* 語言選項改成連結（WPML 換頁），沿用 button 的樣式 */
.language-menu a {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  padding: 10px;
  border-radius: 4px;
  color: var(--white);
  font-size: 0.92rem;
  font-weight: 300;
}

.language-menu a:hover,
.language-menu a[aria-selected="true"] {
  background: rgba(255, 255, 255, 0.1);
}

.language-menu a[aria-selected="true"] {
  color: var(--sand);
}

/* 卡片標題成為連結 */
.publication-body h3 a,
.text-card h3 a {
  color: inherit;
}

.publication-body h3 a:hover,
.text-card h3 a:hover {
  color: var(--sand-deep);
}

/* 內頁有固定頂欄，第一個區塊要讓出高度（首頁 hero 自帶） */
.single-entry,
.archive-band {
  padding-top: 150px;
}

.legal-page {
  padding-top: 150px;
}

/* 法務頁容器 860px，大標縮一檔讓 "TERMS OF SERVICE" 一行放得下 */
.legal-page h1 {
  font-size: clamp(2.2rem, 4.6vw, 3.6rem);
  line-height: 1;
}

/* 編輯器輸出 */
.entry-content > :last-child {
  margin-bottom: 0;
}

.legal-page .entry-content p,
.legal-page .entry-content li {
  color: var(--muted);
  font-size: 1.08rem;
}

.entry-content a {
  color: var(--sand-deep);
  text-decoration: underline;
  text-underline-offset: 4px;
}

.entry-content ul,
.entry-content ol {
  padding-left: 1.4em;
}

.entry-content img {
  height: auto;
}

.entry-content figure {
  margin: 0 0 1.5rem;
}

.entry-content h2,
.entry-content h3 {
  margin-bottom: 0.6em;
}

.entry-content h2 {
  font-size: clamp(1.6rem, 3vw, 2.4rem);
}

/* 分頁：WP 輸出的 .nav-links 與頂欄同名，提高特定性蓋掉 */
.pagination {
  margin-top: 34px;
}

.pagination .nav-links {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  color: var(--navy);
  font-size: 0.9rem;
  font-weight: 900;
  text-transform: uppercase;
}

.pagination .nav-links a,
.pagination .nav-links span {
  padding: 8px 12px;
  border: 2px solid var(--line);
  border-radius: 4px;
}

.pagination .nav-links a:hover {
  color: var(--navy);
  border-color: var(--sand);
}

.pagination .nav-links .current {
  background: var(--sand);
  border-color: var(--sand);
  color: var(--navy);
}

.navy-band .pagination .nav-links {
  color: var(--white);
}

.navy-band .pagination .nav-links a,
.navy-band .pagination .nav-links span {
  border-color: rgba(255, 255, 255, 0.3);
}

.navy-band .pagination .nav-links a:hover {
  color: var(--white);
  border-color: var(--sand);
}

.section-actions .lead {
  align-self: center;
}

/* CJK（Polylang 切到 zh／ja 時 html lang 會變）：Inter 沒有漢字，交給系統字體；標題不拉大寫、行高放寬 */
:lang(zh),
:lang(ja) {
  font-family: "Inter", "Noto Sans TC", "Noto Sans JP", "PingFang TC", "Hiragino Sans", "Microsoft JhengHei", "Yu Gothic", sans-serif;
  line-height: 1.7;
  overflow-wrap: anywhere;
}

:lang(zh) h1,
:lang(zh) h2,
:lang(ja) h1,
:lang(ja) h2 {
  line-height: 1.15;
  letter-spacing: 0.02em;
}

:lang(zh) h1,
:lang(ja) h1 {
  font-size: clamp(2.4rem, 5.5vw, 4.6rem);
}

:lang(zh) h2,
:lang(ja) h2 {
  font-size: clamp(1.9rem, 4vw, 3.6rem);
}

:lang(zh) .nav-links,
:lang(ja) .nav-links {
  gap: 16px;
}

/* 輪播箭頭：圖片兩側圓形小鈕，滑過才顯示；無 hover 的裝置淡淡常駐 */
.carousel-arrow {
  position: absolute;
  top: 50%;
  z-index: 2;
  display: grid;
  place-items: center;
  width: 36px;
  height: 36px;
  border: 0;
  border-radius: 50%;
  background: rgba(16, 21, 31, 0.6);
  color: var(--white);
  cursor: pointer;
  font: inherit;
  font-size: 1.6rem;
  line-height: 1;
  transform: translateY(-50%);
  opacity: 0;
  transition: opacity 180ms ease, background 180ms ease;
}

.carousel-arrow-prev {
  left: 10px;
}

.carousel-arrow-next {
  right: 10px;
}

.carousel:hover .carousel-arrow,
.carousel:focus-within .carousel-arrow {
  opacity: 1;
}

.carousel-arrow:hover,
.carousel-arrow:focus-visible {
  background: var(--sand);
  color: var(--navy);
}

@media (hover: none) {
  .carousel-arrow {
    opacity: 0.7;
  }
}

/* 單頁只有圖沒有正文：圖置中、限寬 */
.feature-grid.media-only {
  grid-template-columns: minmax(0, 760px);
  justify-content: center;
}

/* 作品與資料：分類列（沿用分頁的方框樣式）與卡片的日期＋分類 */
.category-nav {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin: -18px 0 30px;
  color: var(--navy);
  font-size: 0.9rem;
  font-weight: 900;
  text-transform: uppercase;
}

.category-nav-sub {
  margin-top: -18px;
}

.category-nav a,
.category-nav span {
  padding: 8px 12px;
  border: 2px solid var(--line);
  border-radius: 4px;
}

.category-nav a:hover {
  color: var(--navy);
  border-color: var(--sand);
}

.category-nav .current {
  background: var(--sand);
  border-color: var(--sand);
}

.category-nav-sub .current {
  background: transparent;
  border-color: var(--sand-deep);
  color: var(--sand-deep);
}

.text-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 6px 18px;
}

.kicker a {
  color: inherit;
}

.text-meta a {
  color: var(--navy);
}

.text-meta a:hover {
  color: var(--sand-deep);
}

/* 一般文章：標題是整句編輯內容，不是法務頁那種兩個字的大標；縮一檔、不全大寫，
   特定性 (0,2,1) 蓋過 :lang(zh) h1。 */
.legal-page.single-post h1 {
  font-size: clamp(1.7rem, 2.8vw, 2.5rem);
  line-height: 1.25;
  text-transform: none;
}
