/* /homes/ catalog only. Loads after site.css and home.css; card/grid rules are
   scoped to .inner-page so the homepage cards keep their own styling. */

.inner-page {
  max-width: 1200px;
  margin: 0 auto;
  padding: 40px 24px 64px;
  background: var(--paper);
  color: var(--ink);
}

.inner-title {
  margin: 0 0 8px;
  font-size: 40px;
  line-height: 1.2;
  letter-spacing: -0.01em;
  color: var(--ink);
}

.inner-page .result-count {
  margin: 0 0 28px;
  font-size: 14px;
  color: var(--ink);
  opacity: 0.7;
}

.inner-page .catalog-section + .catalog-section {
  margin-top: 48px;
}

.inner-page .catalog-section h2 {
  margin: 0 0 20px;
  font-size: clamp(24px, 3vw, 32px);
  color: var(--ink);
}

.inner-page .property-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 24px;
}

.inner-page .property-card {
  display: flex;
  flex-direction: column;
  margin: 0;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: #fff;
  overflow: hidden;
}

/* site.css sets .property-image to clamp(210px,21vw,360px); the catalog wants a
   compact 4:3 area instead, so height is reset before aspect-ratio applies. */
.inner-page .property-image {
  display: block;
  position: relative;
  height: auto;
  min-height: 150px;
  aspect-ratio: 4 / 3;
  max-height: 240px;
  overflow: hidden;
  background: var(--line);
}

.inner-page .property-image img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

/* site.css sets .property-tag top:16px; without resetting bottom the tag is
   pinned to both edges and stretches over the whole photo. */
.inner-page .property-tag {
  position: absolute;
  top: 12px;
  bottom: auto;
  left: 12px;
  padding: 4px 10px;
  border-radius: 4px;
  background: var(--accent);
  color: #fff;
  font-size: 12px;
  line-height: 1.4;
}

.inner-page .property-info {
  display: flex;
  flex-direction: column;
  flex: 1;
  padding: 14px 16px 16px;
}

.inner-page .property-location {
  margin: 0 0 6px;
  font-size: 13px;
  line-height: 1.4;
  color: var(--ink);
  opacity: 0.65;
}

.inner-page .property-info h3 {
  margin: 0 0 14px;
  font-size: 17px;
  line-height: 1.35;
  color: var(--ink);
}

.inner-page .property-info h3 a {
  color: var(--ink);
  text-decoration: none;
}

.inner-page .property-info h3 a:hover {
  color: var(--accent);
}

.inner-page .property-info h3 a:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

.inner-page .property-bottom {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 8px;
  margin-top: auto;
  padding-top: 12px;
  border-top: 1px solid var(--line);
}

.inner-page .property-bottom strong {
  font-size: 17px;
  font-weight: 600;
  color: var(--accent);
}

.inner-page .property-bottom span {
  font-size: 13px;
  color: var(--ink);
  opacity: 0.7;
}

.inner-page .pager {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  margin-top: 36px;
}

.inner-page .page-link,
.inner-page .pager-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 44px;
  min-height: 44px;
  padding: 0 12px;
  border: 1px solid var(--line);
  border-radius: 4px;
  background: #fff;
  color: var(--ink);
  font-size: 15px;
  text-decoration: none;
}

.inner-page .page-link:hover,
.inner-page .pager-link:hover {
  border-color: var(--accent);
  color: var(--accent);
}

.inner-page .page-link:focus-visible,
.inner-page .pager-link:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

.inner-page .pager .is-current {
  border-color: var(--accent);
  background: var(--accent);
  color: #fff;
}

.inner-page .pager .is-disabled,
.inner-page .pager .is-disabled:hover {
  border-color: var(--line);
  background: transparent;
  color: var(--ink);
  opacity: 0.4;
  pointer-events: none;
}

@media (max-width: 1000px) {
  .inner-page .property-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 700px) {
  .inner-page {
    padding: 28px 16px 48px;
  }

  .inner-title {
    font-size: 30px;
  }

  .inner-page .property-grid {
    grid-template-columns: 1fr;
    gap: 18px;
  }

  .inner-page .property-image {
    max-height: none;
  }
}

/* /shorts/ catalog. Appended only: nothing above changes, and every rule below
   is scoped to .video-page so the property catalog keeps its own styling. The
   Shorts page reuses the .inner-page shell, so .inner-title, .result-count and
   the .pager rules above already cover it. */

.video-page .video-intro {
  margin: 0 0 24px;
  font-size: 14px;
  line-height: 1.5;
  color: var(--ink);
  opacity: 0.7;
}

.video-page-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin: 0 0 24px;
}

.video-page .article-promos {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px 24px;
}

.video-page .article-promos h2 {
  margin: 0;
}

.article-index-intro {
  margin: 0 0 24px;
  line-height: 1.6;
}

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

.article-index-card {
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
}

.article-index-link {
  display: block;
  height: 100%;
  color: var(--ink);
  text-decoration: none;
}

.article-index-link:hover {
  border-color: var(--accent);
  color: var(--accent);
}

.article-index-link:focus-visible {
  outline: 3px solid var(--accent);
  outline-offset: -3px;
}

.article-index-link img {
  display: block;
  width: 100%;
  aspect-ratio: 16 / 9;
  object-fit: cover;
}

.article-index-copy {
  padding: 20px;
}

.article-index-label {
  color: var(--accent);
  font-size: 13px;
  font-weight: 700;
}

.article-index-copy h2 {
  margin: 8px 0 12px;
  font-size: 21px;
  line-height: 1.4;
}

.article-index-copy p {
  margin: 0 0 18px;
  line-height: 1.6;
}

.article-index-cta {
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  padding: 0 16px;
  border-radius: 4px;
  background: var(--accent);
  color: #fff;
  font-weight: 700;
}

/* two equal columns on desktop; the 700px query below drops it to one. */
.video-page .video-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 24px;
}

/* the card is a plain flex column sized by its content: the 2:3 embed sets the
   height, caption and article button follow below it. */
.video-page .short-card {
  display: flex;
  flex-direction: column;
  margin: 0;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  overflow: hidden;
}

/* portrait Shorts embed: the ratio sits on the iframe itself, so the video
   keeps 2:3 (width:height) at any column width without a JS-sized wrapper. */
.video-page .short-embed {
  display: block;
  flex: 0 0 auto;
  width: 100%;
  height: auto;
  aspect-ratio: 2 / 3;
  border: 0;
  background: var(--line);
}

.video-page .short-card h3 {
  display: -webkit-box;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
  line-clamp: 2;
  overflow: hidden;
  margin: 0;
  padding: 12px 14px;
  border-top: 1px solid var(--line);
  font-size: 16px;
  line-height: 1.35;
  color: var(--ink);
}

.video-page .short-card h3 a {
  color: var(--ink);
  text-decoration: none;
}

.video-page .short-card h3 a:hover {
  color: var(--accent);
}

.video-page .short-card h3 a:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

@media (max-width: 700px) {
  .video-page .video-grid {
    grid-template-columns: 1fr;
    gap: 18px;
  }

  .video-page .article-promos,
  .article-index-grid {
    grid-template-columns: 1fr;
  }
}

/* Article feature. Selectors mirror the rendered markup:
   div.article-promos > h2/h3 > a.article-promo, p.short-article > a.article-link
   on the .short-card, .video-embed > iframe.video-embed-frame, .article-body >
   h1 and form.article-form > button. Palette, type scale and spacing reuse the
   rules above; no new color system. */

/* --- published-article entry points (home + /shorts/) -------------------- */

/* flat brand-color field, no shadow or gradient; white type keeps the links
   readable on the teal fill. */
.article-promos {
  margin: 0 0 28px;
  padding: 20px 24px;
  border-radius: 6px;
  background: var(--accent);
  color: #fff;
}

.article-promos h2 {
  margin: 0 0 12px;
  font-size: 20px;
  line-height: 1.3;
  color: #fff;
}

.article-promos h3 {
  margin: 0;
  font-size: 16px;
  line-height: 1.4;
}

.article-promos .article-promo {
  display: flex;
  align-items: center;
  min-height: 44px;
  padding: 0 2px;
  color: #fff;
  font-size: 16px;
  line-height: 1.4;
  text-decoration: none;
}

.article-promos .article-promo:hover {
  text-decoration: underline;
}

.article-promos .article-promo:focus-visible {
  outline: 2px solid #fff;
  outline-offset: 2px;
}

/* --- 閱讀文章 button on the .short-card (home + /shorts/) ---------------- */

/* In the catalog the button is a normal flex row of the card, below the 2:3
   embed, so it never covers the video. */
.video-page .short-card .short-article {
  margin: 0;
  padding: 12px 14px;
  border-top: 1px solid var(--line);
}

.short-card .short-article > .article-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 44px;
  padding: 0 16px;
  border: 1px solid var(--accent);
  border-radius: 4px;
  background: var(--accent);
  color: #fff;
  font-size: 14px;
  line-height: 1.4;
  text-decoration: none;
}

.short-card .short-article > .article-link:hover {
  background: var(--paper);
  color: var(--accent);
}

.short-card .short-article > .article-link:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

/* --- public article view ------------------------------------------------- */

.video-article {
  max-width: 820px;
  margin: 0 auto;
  padding: 40px 24px 64px;
  background: var(--paper);
  color: var(--ink);
}

/* the article also renders inside the .inner-page shell, which already supplies
   the page width and padding. */
.inner-page .video-article {
  padding: 0;
}

/* the ratio belongs on the container; the iframe fills it, so the embed stays
   16:9 at any width without a JS-sized wrapper. */
.video-article .video-embed {
  position: relative;
  width: 100%;
  aspect-ratio: 16 / 9;
  margin: 0 0 24px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: var(--line);
  overflow: hidden;
}

.video-article .video-embed > .video-embed-frame {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  border: 0;
}

.preview-notice {
  margin: 0 0 24px;
  padding: 12px 16px;
  border: 1px solid var(--line);
  border-left: 4px solid var(--accent);
  border-radius: 4px;
  background: var(--white);
  color: var(--ink);
  font-size: 14px;
  line-height: 1.5;
}

.preview-notice a {
  color: var(--accent);
}

.preview-notice a:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

/* a narrow measure keeps long editorial copy readable on wide screens */
.video-article .article-body {
  max-width: 68ch;
  font-size: 17px;
  line-height: 1.7;
  color: var(--ink);
}

.video-article .article-body > h1 {
  margin: 0 0 12px;
  font-size: 34px;
  line-height: 1.25;
  letter-spacing: -0.01em;
  color: var(--ink);
}

.video-article .article-summary {
  margin: 0 0 24px;
  font-size: 18px;
  line-height: 1.6;
  color: var(--ink);
  opacity: 0.75;
}

.video-article .article-content > :first-child {
  margin-top: 0;
}

.video-article .article-content p {
  margin: 0 0 18px;
}

.video-article .article-content h2 {
  margin: 32px 0 10px;
  font-size: 22px;
  line-height: 1.3;
  color: var(--ink);
}

.video-article .article-content h3 {
  margin: 26px 0 8px;
  font-size: 18px;
  line-height: 1.35;
  color: var(--ink);
}

.video-article .article-content ul,
.video-article .article-content ol {
  margin: 0 0 18px;
  padding-left: 22px;
}

.video-article .article-content li {
  margin: 0 0 6px;
}

.video-article .article-content blockquote {
  margin: 0 0 18px;
  padding: 4px 0 4px 16px;
  border-left: 3px solid var(--accent);
  color: var(--ink);
  opacity: 0.8;
}

.video-article .article-content a {
  color: var(--accent);
}

.video-article .article-content a:hover {
  text-decoration: none;
}

.video-article .article-content a:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

.video-article .article-content img {
  display: block;
  width: 100%;
  height: auto;
  border-radius: 6px;
}

/* --- prev / back / next navigation, rendered above and below the body ---- */

/* three equal columns hold at 390px (about 114px each) because minmax(0,1fr)
   lets a column shrink instead of pushing the row past the viewport;
   overflow-wrap keeps a long label inside its own column. */
.video-article .article-nav {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
  margin: 24px 0;
}

.video-article .article-nav a {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 44px;
  padding: 8px 12px;
  border: 1px solid var(--line);
  border-radius: 4px;
  background: var(--white);
  color: var(--ink);
  font-size: 14px;
  line-height: 1.4;
  text-align: center;
  overflow-wrap: anywhere;
  text-decoration: none;
}

.video-article .article-nav a:hover {
  border-color: var(--accent);
  background: var(--paper);
  color: var(--accent);
}

.video-article .article-nav a:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

/* 下一個影片 is the forward step, so it carries the accent fill. .is-next
   matches the pager's is-* modifiers; :last-child covers markup that ships no
   modifier class, since the next link is the last of the three.
   shortcut: if the nav order ever changes, drop the :last-child selector. */
.video-article .article-nav a.is-next,
.video-article .article-nav a:last-child {
  border-color: var(--accent);
  background: var(--accent);
  color: #fff;
}

.video-article .article-nav a.is-next:hover,
.video-article .article-nav a:last-child:hover {
  background: var(--paper);
  color: var(--accent);
}

.video-article .article-nav a.is-next:focus-visible,
.video-article .article-nav a:last-child:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

.article-transcript {
  margin: 32px 0 0;
  padding: 18px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: var(--white);
}

.article-transcript h2 {
  margin: 0 0 10px;
  font-size: 18px;
  line-height: 1.3;
  color: var(--ink);
}

.transcript-body {
  max-height: 320px;
  overflow-y: auto;
  margin: 0;
  padding: 12px 14px;
  border: 1px solid var(--line);
  border-radius: 4px;
  background: var(--paper);
  color: var(--ink);
  font-size: 15px;
  line-height: 1.65;
  white-space: pre-wrap;
}

.transcript-body p {
  margin: 0 0 10px;
}

.tag-list {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 24px 0 0;
  padding: 0;
  list-style: none;
}

.tag-list li,
.tag-list a {
  display: inline-flex;
  align-items: center;
  min-height: 28px;
  padding: 4px 10px;
  border: 1px solid var(--line);
  border-radius: 4px;
  background: var(--white);
  color: var(--ink);
  font-size: 12px;
  line-height: 1.4;
  text-decoration: none;
}

.tag-list a:hover {
  border-color: var(--accent);
  color: var(--accent);
}

.tag-list a:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

.related-articles {
  margin-top: 36px;
  padding-top: 24px;
  border-top: 1px solid var(--line);
}

.related-articles h2 {
  margin: 0 0 14px;
  font-size: 20px;
  line-height: 1.3;
  color: var(--ink);
}

.related-articles ul,
.related-articles ol {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 12px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.related-articles a {
  display: block;
  padding: 12px 14px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: var(--white);
  color: var(--ink);
  font-size: 15px;
  line-height: 1.4;
  overflow-wrap: anywhere;
  text-decoration: none;
}

.related-articles .related-more {
  margin: 16px 0 0;
}

.related-articles .related-more a {
  display: inline-flex;
  color: var(--accent-dark);
}

.related-articles a:hover {
  border-color: var(--accent);
  color: var(--accent);
}

.related-articles a:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

/* --- editor: article form + video list ---------------------------------- */

/* mirrors the existing two-column .editor form; a label holding a textarea or a
   select spans the full width.
   shortcut: label:has(...) needs a current browser; upgrade to a helper class
   on the wide labels if old browsers must be supported. */
.editor .article-form {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 16px 20px;
}

.editor .article-form label:has(textarea),
.editor .article-form label:has(select),
.editor .article-form .preview-notice {
  grid-column: 1 / -1;
}

.editor .article-form label {
  display: flex;
  flex-direction: column;
  gap: 6px;
  font-size: 13px;
  line-height: 1.4;
  color: var(--ink);
  opacity: 0.85;
}

.editor .article-form input,
.editor .article-form textarea,
.editor .article-form select {
  width: 100%;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: 4px;
  background: var(--white);
  color: var(--ink);
  font: inherit;
  line-height: 1.5;
}

.editor .article-form textarea {
  min-height: 140px;
  resize: vertical;
}

.editor .article-form input:focus-visible,
.editor .article-form textarea:focus-visible,
.editor .article-form select:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 1px;
}

/* the actions are direct buttons of the form, so they grid-place like the
   fields instead of sitting in a wrapper row. */
.editor .article-form > button {
  min-height: 44px;
  padding: 0 18px;
  border: 1px solid var(--accent);
  border-radius: 4px;
  background: var(--accent);
  color: #fff;
  font: inherit;
  font-size: 15px;
  cursor: pointer;
}

.editor .article-form > button:hover {
  background: var(--paper);
  color: var(--accent);
}

.editor .article-form > button:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

.editor .video-list {
  display: grid;
  gap: 10px;
  margin: 0 0 28px;
  padding: 0;
  list-style: none;
}

.editor .video-list > li,
.editor .video-list > div {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 12px;
  padding: 12px 14px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: var(--white);
  font-size: 15px;
  line-height: 1.4;
}

.editor .video-list a {
  color: var(--ink);
  text-decoration: none;
}

.editor .video-list a:hover {
  color: var(--accent);
}

.editor .video-list a:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

.editor .video-list .status {
  padding: 3px 10px;
  border: 1px solid var(--line);
  border-radius: 4px;
  color: var(--ink);
  font-size: 11px;
  line-height: 1.6;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  opacity: 0.75;
}

.editor .video-list .status.is-published {
  border-color: var(--accent);
  background: var(--accent);
  color: #fff;
  opacity: 1;
}

.editor .video-list .status.is-draft {
  border-style: dashed;
  background: transparent;
}

@media (max-width: 700px) {
  .video-article {
    padding: 28px 16px 48px;
  }

  .video-article .article-body > h1 {
    font-size: 26px;
  }

  .video-article .article-body {
    font-size: 16px;
  }

  .video-article .article-summary {
    font-size: 17px;
  }

  /* the three nav buttons stay side by side at 390px; tighter padding keeps
     each label on one line without widening the row */
  .video-article .article-nav {
    gap: 6px;
    margin: 20px 0;
  }

  .video-article .article-nav a {
    padding: 8px 6px;
    font-size: 13px;
  }

  .transcript-body {
    max-height: 240px;
  }

  .article-promos {
    padding: 16px 18px;
  }

  /* one column everywhere on mobile: form fields, action buttons, related
     links and editor rows */
  .editor .article-form {
    grid-template-columns: 1fr;
  }

  .editor .video-list > li,
  .editor .video-list > div {
    flex-direction: column;
    align-items: flex-start;
  }
}
