/* Responsive design layer: keeps the desktop palette and typography on every device. */
:root {
  color-scheme: only light;
  --page: #eee5da;
  --categories: #ded0c0;
  --ideas: #d6c5b3;
  --card: #f8f2ec;
  --ink: #302b28;
  --muted: #5f554e;
  --dark: #51443b;
  --footer: #40362f;
  --accent: #d5b28e;
}

/* Safari/iOS: preserve the exact desktop palette instead of browser tinting. */
@supports (-webkit-touch-callout: none) {
  html,
  body {
    color-scheme: only light;
    background: #eee5da !important;
  }

  .categories { background: #ded0c0 !important; }
  .ideas { background: #d6c5b3 !important; }
  .finder,
  .about-section,
  .article,
  .rich-article { background: #eee5da !important; }
  .category-card,
  .travel-card,
  .empty { background: #f8f2ec !important; }
  .finder-box { background: #51443b !important; }
  footer { background: #40362f !important; }
}

html {
  background: var(--page);
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
}

body {
  background: var(--page);
  color: var(--ink);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

body,
button,
input,
select,
textarea {
  font-family: Arial, "Helvetica Neue", Helvetica, sans-serif;
}

button,
input,
select,
textarea {
  color: var(--ink);
}

button,
select,
.btn,
.category-card {
  -webkit-tap-highlight-color: transparent;
  touch-action: manipulation;
}

a:focus-visible,
button:focus-visible,
select:focus-visible {
  outline: 3px solid #8b6e55;
  outline-offset: 3px;
}

.categories { background-color: var(--categories); }
.ideas { background-color: var(--ideas); }
.finder,
.about-section,
.article,
.rich-article { background-color: var(--page); }
.category-card,
.travel-card,
.empty { background-color: var(--card); }

.section-heading h2,
.category-card h3,
.travel-body h3,
.about h2 {
  color: var(--ink);
}

.section-heading p,
.category-card p,
.travel-body p,
.about p {
  color: var(--muted);
}

.finder-grid select {
  appearance: none;
  -webkit-appearance: none;
  color: var(--ink);
  background-color: var(--card);
  background-image:
    linear-gradient(45deg, transparent 50%, var(--dark) 50%),
    linear-gradient(135deg, var(--dark) 50%, transparent 50%);
  background-position:
    calc(100% - 18px) 50%,
    calc(100% - 13px) 50%;
  background-size: 5px 5px, 5px 5px;
  background-repeat: no-repeat;
  padding-right: 38px;
  font-size: 16px;
  font-weight: 600;
}

.finder-grid button {
  color: var(--ink);
  background-color: var(--accent);
  font-size: 16px;
}

/* Tablet: retain the spacious desktop composition in a two-column layout. */
@media (min-width: 701px) and (max-width: 1050px) {
  .container { width: min(100% - 56px, 930px); }
  .nav { height: 80px; }
  .logo { font-size: 34px; }
  .nav nav { gap: 20px; }
  .hero { min-height: 700px; }
  .hero-content { max-width: 720px; }
  .hero-title { font-size: clamp(58px, 8vw, 72px); }
  section { padding: 76px 0; }
  .section-heading { margin-bottom: 38px; }
  .section-heading h2 { font-size: clamp(48px, 7vw, 62px); }
  .category-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .category-card { min-height: 190px; }
  .category-card p { font-size: 15px; line-height: 1.55; }
  .travel-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .travel-card img { height: 235px; }
  .finder-box { min-height: 390px; padding: 50px 34px; }
  .finder-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .finder-grid button { grid-column: 1 / -1; min-height: 56px; }
  .about { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 36px; }
  .about img { min-height: 360px; }
  .article-wrap { width: min(100% - 56px, 930px); }
}

/* Phone: a deliberate mobile design, not just a collapsed desktop grid. */
@media (max-width: 700px) {
  html { background: var(--footer) !important; }
  body { background: var(--page) !important; }

  .container { width: calc(100% - 28px); }
  .nav { height: 76px; }
  .logo { font-size: 32px; letter-spacing: -1.2px; }

  .hero { min-height: 700px; }
  .hero-slide { background-position: center center; }
  .hero-content { max-width: 100%; padding: 92px 0 58px; }
  .hero-label {
    margin-bottom: 16px;
    padding: 7px 12px;
    font-size: 13px;
    line-height: 1.35;
  }
  .hero-title {
    margin-bottom: 22px;
    font-size: clamp(38px, 11.5vw, 48px);
    line-height: 1.02;
    letter-spacing: -1.8px;
  }
  .hero-content > p {
    margin-bottom: 30px;
    font-size: 18px;
    line-height: 1.55;
  }
  .hero-actions { display: grid; gap: 10px; }
  .btn { min-height: 54px; display: grid; place-items: center; text-align: center; }
  .slider-dots { bottom: 22px; }

  section { padding: 64px 0; }
  .section-heading { margin-bottom: 32px; }
  .section-heading h2 {
    margin-bottom: 16px;
    font-size: clamp(36px, 11vw, 44px);
    line-height: 1.02;
    letter-spacing: -1.6px;
  }
  .section-heading p { font-size: 17px; line-height: 1.6; }

  .category-grid { grid-template-columns: 1fr; gap: 14px; }
  .category-card {
    min-height: 0;
    padding: 20px;
    display: grid;
    grid-template-columns: 46px minmax(0, 1fr);
    gap: 14px;
    align-items: center;
    border-radius: 18px;
    color: var(--ink);
  }
  .category-card .icon { font-size: 31px; align-self: start; line-height: 1.15; }
  .category-card h3 { margin-bottom: 5px; font-size: 21px; line-height: 1.2; }
  .category-card p { font-size: 16px; line-height: 1.5; }
  .category-card.selected {
    transform: none;
    border-color: #6e5b4c66;
    box-shadow: 0 10px 28px #4833251c;
  }

  .travel-grid { grid-template-columns: 1fr; gap: 18px; }
  .travel-card { border-radius: 20px; }
  .travel-card img { height: 225px; }
  .travel-body { padding: 20px; }
  .tags { gap: 7px; }
  .tags span { padding: 6px 10px; font-size: 13px; }
  .travel-body h3 { font-size: 24px; line-height: 1.2; }
  .travel-body p { font-size: 16px; line-height: 1.55; }
  .filter-info { padding: 16px; font-size: 15px; line-height: 1.45; }
  .filter-info button { min-height: 44px; padding: 9px 13px; font-size: 15px; }

  .finder-box {
    min-height: 0;
    padding: 36px 18px;
    border-radius: 22px;
  }
  .finder-box h2 { margin-bottom: 12px; font-size: 36px; line-height: 1.08; }
  .finder-box > p { margin-bottom: 28px; font-size: 17px; line-height: 1.55; }
  .finder-grid { grid-template-columns: 1fr; gap: 12px; }
  .finder-grid select,
  .finder-grid button {
    width: 100%;
    min-height: 58px;
    border-radius: 12px;
    font-size: 16px;
  }
  .finder-grid select { padding-left: 16px; }
  .finder-grid button { margin-top: 2px; font-size: 17px; }

  .about { grid-template-columns: 1fr; gap: 30px; }
  .about img { min-height: 0; height: 270px; border-radius: 22px; }
  .about h2 { font-size: 36px; line-height: 1.08; letter-spacing: -1px; }
  .about p { font-size: 17px; line-height: 1.6; }

  footer {
    width: 100%;
    padding: 42px 0 calc(42px + env(safe-area-inset-bottom));
    overflow: hidden;
    background: var(--footer);
  }
  footer .container.footer {
    width: auto;
    max-width: none;
    margin-right: max(14px, env(safe-area-inset-right));
    margin-left: max(14px, env(safe-area-inset-left));
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    justify-content: flex-start;
    gap: 10px;
    line-height: 1.5;
  }
  .footer b,
  .footer span {
    display: block;
    max-width: 100%;
    overflow-wrap: anywhere;
  }
  .footer b { font-size: 25px; }
  .footer span { color: #ded4cc; font-size: 14px; }

  .article-nav .container { height: 68px; }
  .article { padding: 34px 0 52px; }
  .rich-article .article-hero { margin-bottom: 38px; }
  .rich-article .article-hero > img {
    height: min(48vh, 430px);
    min-height: 290px;
    margin-bottom: 26px;
    border-radius: 22px;
  }
  .article h1 {
    font-size: clamp(35px, 10.5vw, 46px);
    line-height: 1.04;
    letter-spacing: -1.7px;
  }
  .rich-article .article-excerpt {
    margin: 18px 0 32px;
    color: var(--muted);
    font-size: 18px;
    line-height: 1.62;
  }
  .post-chips { margin-top: -12px; gap: 7px; }
  .post-chip,
  .destination-tags span { font-size: 13px; }
  .post-toc { margin: 38px auto 52px; padding: 22px; border-radius: 20px; }
  .post-toc h2 { font-size: 25px; }
  .post-toc-grid { gap: 4px; }
  .post-toc a { padding: 10px 0; font-size: 16px; }
  .destination-block { margin-bottom: 38px; padding: 22px 18px; }
  .destination-block h2 { font-size: 32px; letter-spacing: -1px; }
  .destination-intro { font-size: 17px; line-height: 1.65; }
  .post-gallery { gap: 8px; }
  .post-gallery img,
  .post-gallery.gallery-3 img,
  .post-gallery.gallery-4 img { height: 245px; border-radius: 14px; }
  .destination-info > div { padding: 16px; font-size: 16px; line-height: 1.5; }
  .main-impression { padding: 18px; font-size: 16px; line-height: 1.55; }
  .post-summary { margin-bottom: 42px; padding: 24px 20px; border-radius: 22px; }
  .post-summary h2 { font-size: 30px; line-height: 1.12; }
  .post-summary-grid div { padding: 15px; font-size: 16px; line-height: 1.5; }
  .prose { font-size: 17px; line-height: 1.65; }
  .prose h2 { font-size: 30px; line-height: 1.15; }
}

@media (max-width: 390px) {
  .hero { min-height: 660px; }
  .hero-title { font-size: 37px; }
  .section-heading h2 { font-size: 35px; }
  .category-card { padding: 18px 16px; }
  .finder-box { padding: 32px 16px; }
  .article h1 { font-size: 34px; }
}

@media (hover: none) {
  .category-card:hover,
  .travel-card:hover { transform: none; }
}

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