/* NowCove — Driftwood Design System */

/* === CSS Custom Properties === */
:root {
  /* Typography */
  --f-display: 'Lora', Georgia, serif;
  --f-serif: 'Lora', Georgia, serif;
  --f-body: 'Sora', sans-serif;
  --f-mono: 'Fira Code', monospace;

  /* Ink */
  --ink: #2a2518;
  --ink-soft: #4a4538;
  --mute: #9a9080;

  /* Surfaces */
  --sand-light: #f7f4ef;
  --sand-mid: #e8e2d8;
  --bg: #faf8f3;
  --white: #ffffff;

  /* Accents */
  --accent: #c47830;
  --accent-dark: #8a5820;

  /* Semantic */
  --green-bg: #edf5f0;
  --green-text: #1a4030;
  --green-label: #2a7050;
  --amber-bg: #fdf6ee;
  --amber-text: #5a4020;
  --amber-label: #906830;
  --alert-bg: #fef3ec;
  --alert-border: #d06030;
  --alert-text: #6a3a1a;
  --alert-label: #905030;
}

/* === Reset & Base === */
*, *::before, *::after { box-sizing: border-box; }
body {
  margin: 0;
  min-height: 100vh;
  background-color: var(--bg);
  color: var(--ink);
  font-family: var(--f-body);
  font-size: 16px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}
img { max-width: 100%; height: auto; display: block; }
a { color: var(--accent-dark); text-decoration: none; }
a:hover { text-decoration: underline; }
h1, h2, h3, h4 { margin: 0; }
p { margin: 0; }
figure { margin: 0; }

/* === Animations === */
@keyframes fadeCard {
  from { opacity: 0; transform: translateY(28px); }
  to { opacity: 1; transform: translateY(0); }
}
@keyframes slideUp {
  from { opacity: 0; transform: translateY(20px); }
  to { opacity: 1; transform: translateY(0); }
}

/* === Layout === */
.dw-wrap {
  max-width: 960px;
  margin: 0 auto;
  padding: 36px 24px 56px;
}
.dw-area-wrap {
  padding: 0 28px;
  max-width: 800px;
  margin: 0 auto;
}

/* ========================================
   HOMEPAGE
   ======================================== */

/* Header */
.dw-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
  margin-bottom: 40px;
}
.dw-brand {
  font-family: var(--f-body);
  font-size: 12px;
  color: var(--mute);
  letter-spacing: 3px;
  text-transform: uppercase;
  margin-bottom: 6px;
}
.dw-title {
  font-family: var(--f-display);
  font-size: 46px;
  font-weight: 400;
  color: var(--ink);
  letter-spacing: -1px;
  line-height: 1;
}
.dw-subtitle {
  font-family: var(--f-serif);
  font-size: 16px;
  color: var(--mute);
  margin-top: 10px;
  font-style: italic;
  max-width: 420px;
  line-height: 1.5;
}
.dw-date {
  font-family: var(--f-mono);
  font-size: 12px;
  color: var(--mute);
  text-align: right;
  flex-shrink: 0;
}

/* Card Grid */
.dw-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 20px;
}
.dw-grid-item {
  animation: fadeCard 0.5s ease both;
}

/* Homepage Card */
.dw-card {
  display: block;
  cursor: pointer;
  border-radius: 12px;
  overflow: hidden;
  background: var(--white);
  box-shadow: 0 2px 12px rgba(120,100,60,0.06);
  transition: all 0.35s cubic-bezier(0.4, 0, 0.2, 1);
  text-decoration: none;
  color: inherit;
}
.dw-card:hover {
  transform: translateY(-6px);
  box-shadow: 0 16px 48px rgba(120,100,60,0.18);
  text-decoration: none;
}
.dw-card-hero {
  position: relative;
  width: 100%;
  height: 220px;
  overflow: hidden;
  background: var(--sand-mid);
}
.dw-card-hero img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.dw-card-overlay {
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, transparent 30%, rgba(20,15,10,0.55) 100%);
}
.dw-card-info {
  position: absolute;
  bottom: 18px;
  left: 20px;
  right: 20px;
  z-index: 1;
}
.dw-card-region {
  font-family: var(--f-body);
  font-size: 11px;
  color: rgba(255,255,255,0.55);
  letter-spacing: 2px;
  text-transform: uppercase;
  margin-bottom: 4px;
}
.dw-card-name {
  font-family: var(--f-display);
  font-size: 32px;
  font-weight: 400;
  color: #fff;
  letter-spacing: -0.5px;
}
.dw-card-temp {
  position: absolute;
  top: 14px;
  right: 16px;
  font-family: var(--f-mono);
  font-size: 24px;
  color: #fff;
  font-weight: 500;
  z-index: 1;
}
.dw-card-alert-bar {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 3px;
  background: linear-gradient(90deg, #e08040, #c04040);
  z-index: 2;
}
.dw-card-body {
  padding: 18px 20px 22px;
}
.dw-card-tagline {
  font-family: var(--f-serif);
  font-size: 16px;
  color: var(--ink);
  margin-bottom: 14px;
  line-height: 1.6;
  font-style: italic;
}
.dw-pills {
  display: flex;
  gap: 5px;
  flex-wrap: wrap;
  margin-bottom: 12px;
}
.dw-pill {
  background: var(--sand-light);
  border-radius: 99px;
  padding: 3px 10px;
  font-family: var(--f-body);
  font-size: 11px;
  color: var(--accent-dark);
  font-weight: 500;
  white-space: nowrap;
}
.dw-card-conditions {
  display: flex;
  gap: 20px;
}
.dw-card-datum-label {
  font-family: var(--f-body);
  font-size: 9px;
  color: var(--mute);
  letter-spacing: 1.5px;
  text-transform: uppercase;
}
.dw-card-datum-value {
  font-family: var(--f-mono);
  font-size: 13px;
  color: var(--ink-soft);
}

/* Homepage Footer */
.dw-footer {
  margin-top: 40px;
  text-align: center;
  font-family: var(--f-body);
  font-size: 12px;
  color: var(--mute);
}

/* ========================================
   AREA DETAIL PAGE
   ======================================== */

.dw-area-page {
  animation: slideUp 0.5s ease;
}

/* Hero */
.dw-hero {
  position: relative;
  width: 100%;
  height: 380px;
  overflow: hidden;
  border-radius: 0 0 16px 16px;
  background: var(--sand-mid);
}
.dw-hero img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.dw-hero-overlay {
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, rgba(20,15,10,0.15) 0%, rgba(20,15,10,0.6) 100%);
}
.dw-hero-back {
  position: absolute;
  top: 20px;
  left: 24px;
  z-index: 2;
  display: inline-block;
  background: rgba(255,255,255,0.15);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  border: 1px solid rgba(255,255,255,0.2);
  border-radius: 99px;
  padding: 6px 16px;
  font-family: var(--f-body);
  font-size: 13px;
  color: #fff;
  font-weight: 500;
  text-decoration: none;
  cursor: pointer;
}
.dw-hero-back:hover { background: rgba(255,255,255,0.25); text-decoration: none; }
.dw-hero-bottom {
  position: absolute;
  bottom: 28px;
  left: 28px;
  right: 28px;
  z-index: 1;
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
}
.dw-hero-region {
  font-family: var(--f-body);
  font-size: 12px;
  color: rgba(255,255,255,0.5);
  letter-spacing: 2px;
  text-transform: uppercase;
  margin-bottom: 4px;
}
.dw-hero-name {
  font-family: var(--f-display);
  font-size: 48px;
  font-weight: 400;
  color: #fff;
  letter-spacing: -1px;
}
.dw-hero-temp {
  font-family: var(--f-mono);
  font-size: 42px;
  color: #fff;
  font-weight: 500;
  line-height: 1;
  text-align: right;
}
.dw-hero-temp-label {
  font-family: var(--f-body);
  font-size: 12px;
  color: rgba(255,255,255,0.5);
  margin-top: 2px;
  text-align: right;
}
.dw-hero-attribution {
  position: absolute;
  bottom: 6px;
  right: 10px;
  z-index: 2;
  font-family: var(--f-body);
  font-size: 10px;
  color: rgba(255,255,255,0.45);
}
.dw-hero-attribution a {
  color: rgba(255,255,255,0.45);
  text-decoration: none;
}
.dw-hero-attribution a:hover { color: rgba(255,255,255,0.7); }

/* Timestamp */
.dw-timestamp {
  font-family: var(--f-body);
  font-size: 12px;
  color: var(--mute);
  margin: 16px 0 24px;
}

/* Alert */
.dw-alert {
  background: var(--alert-bg);
  border-left: 4px solid var(--alert-border);
  border-radius: 0 10px 10px 0;
  padding: 14px 18px;
  margin-bottom: 24px;
}
.dw-alert-label {
  font-family: var(--f-body);
  font-size: 10px;
  color: var(--alert-label);
  letter-spacing: 1.5px;
  text-transform: uppercase;
  margin-bottom: 4px;
  font-weight: 600;
}
.dw-alert-text {
  font-family: var(--f-serif);
  font-size: 14px;
  color: var(--alert-text);
  line-height: 1.5;
}

/* Section Heading */
.dw-sh {
  font-family: var(--f-display);
  font-size: 28px;
  font-weight: 400;
  color: var(--ink);
  letter-spacing: -0.5px;
  padding-top: 40px;
  margin-bottom: 20px;
}

/* Tagline + Vibe */
.dw-tagline {
  font-family: var(--f-serif);
  font-size: 18px;
  color: var(--ink);
  line-height: 1.8;
  font-style: italic;
  margin-bottom: 8px;
}
.dw-vibe {
  font-family: var(--f-serif);
  font-size: 16px;
  color: var(--ink-soft);
  margin-top: 16px;
  line-height: 1.75;
  max-width: 640px;
}

/* Best For / Downsides */
.dw-cards-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px;
  margin: 32px 0;
}
.dw-info-card {
  border-radius: 12px;
  padding: 20px 22px;
}
.dw-info-card--green { background: var(--green-bg); }
.dw-info-card--amber { background: var(--amber-bg); }
.dw-info-card-label {
  font-family: var(--f-body);
  font-size: 11px;
  letter-spacing: 1.5px;
  text-transform: uppercase;
  margin-bottom: 8px;
  font-weight: 600;
}
.dw-info-card--green .dw-info-card-label { color: var(--green-label); }
.dw-info-card--amber .dw-info-card-label { color: var(--amber-label); }
.dw-info-card--green .dw-info-card-text {
  font-family: var(--f-serif);
  font-size: 15px;
  color: var(--green-text);
  line-height: 1.6;
  font-style: italic;
}
.dw-info-card--amber .dw-info-card-text {
  font-family: var(--f-body);
  font-size: 14px;
  color: var(--amber-text);
  line-height: 1.6;
  font-weight: 400;
}

/* === Scorecard === */
.dw-scorecard {
  border: 1px solid var(--sand-mid);
  border-radius: 12px;
  overflow: hidden;
}
.dw-scorecard-row {
  display: grid;
  grid-template-columns: 160px auto 90px;
  gap: 12px;
  align-items: start;
  padding: 14px 18px;
  border-bottom: 1px solid var(--sand-mid);
}
.dw-scorecard-row:last-child { border-bottom: none; }
.dw-scorecard-row:nth-child(odd) { background: var(--white); }
.dw-scorecard-row:nth-child(even) { background: var(--sand-light); }
.dw-scorecard-cat {
  font-family: var(--f-body);
  font-size: 14px;
  color: var(--ink);
  font-weight: 500;
}
.dw-scorecard-desc {
  font-family: var(--f-serif);
  font-size: 13px;
  color: var(--ink-soft);
  line-height: 1.5;
}
.dw-score-dots {
  display: flex;
  gap: 3px;
  justify-content: flex-end;
  padding-top: 2px;
}
.dw-score-dot {
  width: 14px;
  height: 14px;
  border-radius: 3px;
  background: var(--sand-light);
}
.dw-score-dot--filled { background: var(--accent); }
.dw-sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0,0,0,0);
  border: 0;
}

/* === Conditions === */
.dw-section-img {
  width: 100%;
  height: 160px;
  border-radius: 12px;
  overflow: hidden;
  margin-bottom: 16px;
  background: var(--sand-mid);
}
.dw-section-img img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.dw-conditions-card {
  background: var(--sand-light);
  border-radius: 12px;
  padding: 22px 24px;
  margin-bottom: 16px;
}
.dw-conditions-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 16px;
  margin-bottom: 20px;
}
.dw-datum-label {
  font-family: var(--f-body);
  font-size: 10px;
  color: var(--mute);
  letter-spacing: 1.5px;
  text-transform: uppercase;
  margin-bottom: 4px;
}
.dw-datum-value {
  font-family: var(--f-mono);
  font-size: 20px;
  color: var(--ink);
  font-weight: 500;
  word-break: break-word;
}
.dw-conditions-detail {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
}
.dw-forecast-tonight {
  font-family: var(--f-serif);
  font-size: 15px;
  color: var(--ink-soft);
  margin-bottom: 6px;
  line-height: 1.6;
}
.dw-forecast-later {
  font-family: var(--f-serif);
  font-size: 14px;
  color: var(--mute);
  margin-bottom: 4px;
}
.dw-tides-label {
  font-family: var(--f-body);
  font-size: 10px;
  color: var(--mute);
  letter-spacing: 1.5px;
  text-transform: uppercase;
  margin-bottom: 6px;
}
.dw-tides-value {
  font-family: var(--f-mono);
  font-size: 13px;
  color: var(--ink-soft);
  line-height: 1.6;
}
.dw-sun {
  font-family: var(--f-mono);
  font-size: 12px;
  color: var(--mute);
  margin-top: 8px;
}
.dw-surf-note {
  font-family: var(--f-body);
  font-size: 11px;
  color: var(--mute);
  margin-top: 6px;
  font-style: italic;
}

/* === Activities === */
.dw-section-img--short { height: 140px; }
.dw-activity-list {
  display: flex;
  flex-direction: column;
  gap: 12px;
  margin-bottom: 16px;
}
.dw-activity-item {
  display: flex;
  gap: 14px;
  align-items: flex-start;
}
.dw-activity-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--accent);
  margin-top: 8px;
  flex-shrink: 0;
}
.dw-activity-name {
  font-family: var(--f-body);
  font-size: 15px;
  color: var(--ink);
  font-weight: 600;
}
.dw-activity-desc {
  font-family: var(--f-serif);
  font-size: 14px;
  color: var(--ink-soft);
  margin-left: 6px;
}

/* === Dining === */
.dw-dining-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  margin-bottom: 12px;
}
.dw-dining-card {
  background: var(--white);
  border: 1px solid var(--sand-mid);
  border-radius: 10px;
  padding: 14px 16px;
}
.dw-dining-name {
  font-family: var(--f-body);
  font-size: 14px;
  color: var(--ink);
  font-weight: 600;
  margin-bottom: 4px;
}
.dw-dining-desc {
  font-family: var(--f-serif);
  font-size: 13px;
  color: var(--ink-soft);
  line-height: 1.5;
}
.dw-dining-note {
  font-family: var(--f-body);
  font-size: 13px;
  color: var(--mute);
  font-style: italic;
  margin-bottom: 8px;
}

/* === Rentals === */
.dw-rental-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px;
  margin-bottom: 14px;
}
.dw-rental-card {
  background: var(--sand-light);
  border-radius: 12px;
  padding: 16px 20px;
}
.dw-rental-label {
  font-family: var(--f-body);
  font-size: 10px;
  color: var(--mute);
  letter-spacing: 1.5px;
  text-transform: uppercase;
  margin-bottom: 6px;
}
.dw-rental-price {
  font-family: var(--f-mono);
  font-size: 24px;
  color: var(--ink);
  font-weight: 500;
}
.dw-rental-unit {
  font-family: var(--f-body);
  font-size: 12px;
  color: var(--mute);
}
.dw-rental-note {
  font-family: var(--f-serif);
  font-size: 14px;
  color: var(--ink-soft);
  margin-bottom: 6px;
  line-height: 1.6;
}
.dw-rental-companies {
  font-family: var(--f-body);
  font-size: 12px;
  color: var(--mute);
}

/* === Logistics === */
.dw-logistics {
  border: 1px solid var(--sand-mid);
  border-radius: 12px;
  overflow: hidden;
  margin-bottom: 16px;
}
.dw-logistics-row {
  display: grid;
  grid-template-columns: 120px 1fr;
  gap: 12px;
  padding: 12px 16px;
  border-bottom: 1px solid var(--sand-mid);
}
.dw-logistics-row:last-child { border-bottom: none; }
.dw-logistics-row:nth-child(odd) { background: var(--white); }
.dw-logistics-row:nth-child(even) { background: var(--sand-light); }
.dw-logistics-key {
  font-family: var(--f-body);
  font-size: 13px;
  color: var(--ink);
  font-weight: 600;
}
.dw-logistics-val {
  font-family: var(--f-serif);
  font-size: 13px;
  color: var(--ink-soft);
  line-height: 1.5;
}

/* === Photo Grid === */
.dw-photo-grid {
  display: grid;
  grid-template-columns: 2fr 1fr 1fr;
  grid-template-rows: 160px 160px;
  gap: 8px;
  margin-bottom: 32px;
}
.dw-photo-cell {
  border-radius: 10px;
  overflow: hidden;
  position: relative;
  background: var(--sand-mid);
}
.dw-photo-cell img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.dw-photo-cell--span { grid-row: 1 / 3; }
.dw-photo-attr {
  position: absolute;
  bottom: 4px;
  right: 6px;
  font-family: var(--f-body);
  font-size: 9px;
  color: rgba(255,255,255,0.5);
}
.dw-photo-attr a { color: rgba(255,255,255,0.5); }

/* === Page Footer === */
.dw-page-footer {
  font-family: var(--f-body);
  font-size: 12px;
  color: var(--mute);
  padding-bottom: 32px;
  border-top: 1px solid var(--sand-mid);
  padding-top: 16px;
}

/* ========================================
   RESPONSIVE (< 768px)
   ======================================== */
@media (max-width: 767px) {
  .dw-wrap { padding: 24px 16px 40px; }
  .dw-header { flex-direction: column; align-items: flex-start; gap: 12px; }
  .dw-date { text-align: left; }
  .dw-title { font-size: 32px; }
  .dw-grid { grid-template-columns: 1fr; }

  /* Hero */
  .dw-hero { height: 280px; }
  .dw-hero-name { font-size: 36px; }
  .dw-hero-temp { font-size: 32px; }
  .dw-hero-bottom { left: 20px; right: 20px; bottom: 20px; }

  /* Area content */
  .dw-area-wrap { padding: 0 16px; }
  .dw-sh { font-size: 22px; padding-top: 32px; }
  .dw-tagline { font-size: 16px; }
  .dw-vibe { font-size: 15px; }

  /* Best For / Downsides */
  .dw-cards-row { grid-template-columns: 1fr; }

  /* Scorecard — stacked cards */
  .dw-scorecard-row {
    grid-template-columns: 1fr;
    gap: 4px;
    padding: 12px 16px;
  }
  .dw-scorecard-row-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
  }
  .dw-scorecard-cat { font-size: 13px; }
  .dw-scorecard-desc { font-size: 12px; }
  .dw-score-dots { justify-content: flex-start; padding-top: 0; }

  /* Conditions */
  .dw-conditions-grid { grid-template-columns: 1fr 1fr; }
  .dw-conditions-detail { grid-template-columns: 1fr; }
  .dw-datum-value { font-size: 18px; }

  /* Dining */
  .dw-dining-grid { grid-template-columns: 1fr; }

  /* Rentals */
  .dw-rental-grid { grid-template-columns: 1fr; }
  .dw-rental-price { font-size: 20px; }

  /* Logistics — stacked */
  .dw-logistics-row {
    grid-template-columns: 1fr;
    gap: 2px;
  }

  /* Photos */
  .dw-photo-grid {
    grid-template-columns: 1fr 1fr;
    grid-template-rows: 140px 140px;
  }
  .dw-photo-cell--span { grid-row: auto; }
  .dw-photo-cell:nth-child(n+5) { display: none; }
}

/* ========================================
   ADMIN PAGE — keep existing styles
   ======================================== */
.admin-dash h4 { margin-bottom: 0.3rem; }
.admin-dash details { margin-bottom: 0.75rem; }
.admin-dash details > summary { padding: 0.3rem 0; }
.dash-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1rem;
  margin-bottom: 0.75rem;
}
@media (max-width: 768px) { .dash-grid { grid-template-columns: 1fr; } }
.dash-col h4 { margin-bottom: 0.25rem; }
.compact-table { font-size: 0.82rem; margin-bottom: 0; border-collapse: collapse; width: 100%; }
.compact-table th, .compact-table td { padding: 0.3rem 0.5rem; border: 1px solid var(--sand-mid); text-align: left; }
.compact-table code { font-size: 0.78rem; padding: 0; background: none; }
.badge { display: inline-block; padding: 0.1rem 0.4rem; border-radius: 3px; font-size: 0.72rem; font-weight: 600; text-transform: uppercase; letter-spacing: 0.02em; white-space: nowrap; }
.badge-pending { background: #fef3c7; color: #92400e; }
.badge-running { background: #dbeafe; color: #1e40af; }
.badge-done { background: #dcfce7; color: #166534; }
.badge-error { background: #fee2e2; color: #991b1b; }
.badge-idle { background: #f3f4f6; color: #6b7280; }
.btn-sm { padding: 0.2rem 0.5rem !important; font-size: 0.78rem !important; margin-bottom: 0 !important; width: auto !important; background: var(--accent); color: #fff; border: none; border-radius: 4px; cursor: pointer; }
.inline-select { width: auto !important; display: inline-block !important; margin-bottom: 0 !important; padding: 0.2rem 0.4rem !important; font-size: 0.82rem !important; height: auto !important; }
.action-row { display: flex; flex-wrap: wrap; gap: 0.4rem; align-items: center; }
.action-sep { color: var(--mute); margin: 0 0.15rem; }
#config-editor { resize: vertical; width: 100%; font-family: var(--f-mono); font-size: 13px; padding: 8px; border: 1px solid var(--sand-mid); border-radius: 4px; }
.refresh-ts { display: block; text-align: right; color: var(--mute); margin-top: 0.5rem; font-size: 12px; }
