/* ============================================================
   WEB FARM — shared site stylesheet
   Copy into each site. Rebrand by editing ONLY the :root block
   (and optionally the font stack). Do not fork the components.
   ============================================================ */

:root {
  /* -- REBRAND HERE -------------------------------------- */
  --accent:        #c2185b;   /* blush — links / buttons     */
  --accent-dark:   #93143f;   /* deeper blush — hovers       */
  --accent-soft:   #fdf7f2;   /* ivory — tinted backgrounds  */
  --brand-ink:     #4c1226;   /* deep wine / dark surfaces   */
  --champagne:     #b08d3f;   /* champagne — bars & fills    */
  --radius:        12px;
  --maxw:          1080px;
  /* ------------------------------------------------------- */
  --bg:      #fdfcf9;
  --card:    #ffffff;
  --ink:     #1c2430;
  --muted:   #5b6675;
  --line:    #e6e2d8;
  --warn-bg: #fff7e6;
  --warn-line: #f0c36d;
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg:   #14181f;
    --card: #1d232c;
    --ink:  #e8eaee;
    --muted:#9aa5b1;
    --line: #2c343f;
    --accent-soft: #33202a;
    --warn-bg: #2a2317;
    --warn-line: #8a6d2f;
  }
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font: 17px/1.7 -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto,
        "Helvetica Neue", "Noto Sans TC", "Noto Sans SC", Arial, sans-serif;
  -webkit-text-size-adjust: 100%;
}

.wrap { max-width: var(--maxw); margin: 0 auto; padding: 0 20px; }

a { color: var(--accent); text-decoration-thickness: 1px; text-underline-offset: 2px; }
a:hover { color: var(--accent-dark); }

img, svg { max-width: 100%; height: auto; }

/* ---------- header ---------- */
.site-header {
  background: var(--brand-ink);
  color: #fff;
  position: sticky; top: 0; z-index: 50;
}
.site-header .wrap {
  display: flex; align-items: center; gap: 18px;
  min-height: 58px; flex-wrap: wrap; padding-top: 6px; padding-bottom: 6px;
}
.brand {
  display: flex; align-items: center; gap: 10px;
  color: #fff; text-decoration: none; font-weight: 700; font-size: 1.15rem;
  letter-spacing: .2px;
}
.brand:hover { color: #fff; }
.brand svg { flex: none; }

.site-nav { margin-left: auto; display: flex; align-items: center; gap: 4px; flex-wrap: wrap; }
.site-nav a {
  color: #e6e9ee; text-decoration: none; font-size: .95rem;
  padding: 7px 12px; border-radius: 6px;
}
.site-nav a:hover { background: rgba(255,255,255,.12); color: #fff; }
.site-nav a.lang-switch {
  border: 1px solid rgba(255,255,255,.35); margin-left: 6px; font-weight: 600;
}

.nav-toggle {
  display: none; margin-left: auto;
  background: none; border: 1px solid rgba(255,255,255,.4); color: #fff;
  font-size: 1rem; padding: 6px 12px; border-radius: 6px; cursor: pointer;
}

/* ---------- hero (home) ---------- */
.hero { background: linear-gradient(160deg, var(--brand-ink) 0%, var(--accent-dark) 100%); color: #fff; padding: 54px 0 60px; }
.hero h1 { font-size: clamp(1.8rem, 4vw, 2.7rem); line-height: 1.2; margin: 0 0 14px; max-width: 21em; }
.hero p  { font-size: 1.1rem; color: #dbe4de; max-width: 38em; margin: 0 0 22px; }
.hero .lede-actions { display: flex; gap: 12px; flex-wrap: wrap; }
.btn {
  display: inline-block; padding: 11px 20px; border-radius: 8px;
  background: var(--accent); color: #fff !important; text-decoration: none;
  font-weight: 600; border: none; cursor: pointer; font-size: 1rem;
}
.btn:hover { background: var(--accent-dark); color: #fff; }
.btn.ghost { background: transparent; border: 1px solid rgba(255,255,255,.5); }

/* ---------- sections ---------- */
.section { padding: 40px 0; }
.section h2 { font-size: 1.5rem; margin: 0 0 6px; }
.section .sub { color: var(--muted); margin: 0 0 24px; }

/* ---------- article card grid ---------- */
.card-grid {
  display: grid; gap: 18px;
  grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
}
.card {
  background: var(--card); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 20px; display: flex; flex-direction: column; gap: 8px;
  text-decoration: none; color: var(--ink);
  transition: border-color .15s, transform .15s;
}
.card:hover { border-color: var(--accent); transform: translateY(-2px); color: var(--ink); }
.card .kicker { color: var(--accent); font-size: .8rem; font-weight: 700; text-transform: uppercase; letter-spacing: .06em; }
.card h3 { margin: 0; font-size: 1.08rem; line-height: 1.35; }
.card p { margin: 0; color: var(--muted); font-size: .93rem; line-height: 1.55; flex: 1; }

/* ---------- article page ---------- */
.crumbs { font-size: .85rem; color: var(--muted); padding: 16px 0 0; }
.crumbs a { color: var(--muted); }

.article { max-width: 760px; margin: 0 auto; padding: 12px 20px 40px; }
.article-header { border-bottom: 1px solid var(--line); padding-bottom: 18px; margin-bottom: 24px; }
.article-header .kicker { color: var(--accent); font-weight: 700; font-size: .82rem; text-transform: uppercase; letter-spacing: .07em; }
.article-header h1 { font-size: clamp(1.5rem, 3.4vw, 2.1rem); line-height: 1.25; margin: 8px 0 10px; }
.article-header .meta { color: var(--muted); font-size: .88rem; }

.article h2 { font-size: 1.32rem; margin: 34px 0 10px; }
.article h3 { font-size: 1.08rem; margin: 26px 0 8px; }
.article p, .article li { line-height: 1.75; }
.article ul, .article ol { padding-left: 1.4em; }
.article li { margin: 6px 0; }
.article blockquote {
  margin: 18px 0; padding: 10px 18px; border-left: 4px solid var(--accent);
  background: var(--accent-soft); border-radius: 0 8px 8px 0;
}

/* tables */
.table-scroll { overflow-x: auto; margin: 18px 0; }
table { border-collapse: collapse; width: 100%; font-size: .95rem; }
th, td { border: 1px solid var(--line); padding: 9px 12px; text-align: left; vertical-align: top; }
th { background: var(--accent-soft); font-weight: 700; }
tbody tr:nth-child(even) { background: rgba(0,0,0,.015); }

/* callout boxes */
.box { border: 1px solid var(--line); border-left: 4px solid var(--accent); border-radius: 8px;
  background: var(--accent-soft); padding: 16px 18px; margin: 22px 0; }
.box.warn { border-left-color: var(--warn-line); background: var(--warn-bg); }
.box h4 { margin: 0 0 6px; font-size: 1rem; }
.box p, .box ul { margin: 0; }
.box ul { padding-left: 1.3em; }

/* ---------- ad slots (space reserved = no CLS) ---------- */
.ad-slot {
  margin: 26px auto; text-align: center; overflow: hidden;
  min-height: 90px; max-width: 760px;
  background: repeating-linear-gradient(45deg, transparent, transparent 12px, rgba(127,127,127,.045) 12px, rgba(127,127,127,.045) 24px);
  border: 1px dashed var(--line); border-radius: 8px;
}
.ad-slot::before {
  content: "advertisement"; display: block;
  font-size: .65rem; letter-spacing: .18em; text-transform: uppercase;
  color: var(--muted); padding-top: 8px; opacity: .7;
}
.ad-slot.inread { min-height: 250px; }
.ad-slot.rail { min-height: 600px; max-width: 320px; margin: 0 auto; }
.ad-slot:has(ins.adsbygoogle) { background: none; border: none; }
.ad-slot:has(ins.adsbygoogle)::before { content: none; }

/* ---------- affiliate card ---------- */
.affiliate-card {
  display: flex; gap: 16px; align-items: flex-start; flex-wrap: wrap;
  border: 1px solid var(--line); border-radius: var(--radius);
  background: var(--card); padding: 18px; margin: 26px 0;
}
.affiliate-card .thumb {
  flex: none; width: 86px; height: 86px; border-radius: 8px;
  background: var(--accent-soft); display: grid; place-items: center;
  color: var(--accent); font-weight: 800; font-size: 1.5rem;
}
.affiliate-card h4 { margin: 0 0 4px; font-size: 1.02rem; }
.affiliate-card p { margin: 0 0 8px; font-size: .92rem; color: var(--muted); }
.affiliate-card .btn { font-size: .92rem; padding: 9px 16px; }
.affiliate-card .disclosure { flex-basis: 100%; font-size: .78rem; color: var(--muted); }

/* ---------- newsletter ---------- */
.newsletter {
  border: 1px solid var(--line); border-radius: var(--radius);
  background: var(--brand-ink); color: #fff; padding: 30px 26px; margin: 40px 0;
}
.newsletter h2 { margin: 0 0 8px; font-size: 1.35rem; color: #fff; }
.newsletter p { color: #cfd8d1; margin: 0 0 16px; max-width: 34em; }
.newsletter form { display: flex; gap: 10px; flex-wrap: wrap; }
.newsletter input[type="email"] {
  flex: 1; min-width: 220px; padding: 11px 14px; border-radius: 8px;
  border: 1px solid rgba(255,255,255,.3); background: rgba(255,255,255,.08); color: #fff; font-size: 1rem;
}
.newsletter input::placeholder { color: #b9c4bd; }
.newsletter small { display: block; margin-top: 10px; color: #9fb0a5; }

/* ---------- footer ---------- */
.site-footer { background: var(--brand-ink); color: #c9d2cc; margin-top: 50px; padding: 34px 0 40px; font-size: .92rem; }
.site-footer a { color: #e6e9ee; text-decoration: none; }
.site-footer a:hover { text-decoration: underline; }
.footer-cols { display: flex; gap: 40px; flex-wrap: wrap; }
.footer-cols nav { display: flex; flex-direction: column; gap: 8px; min-width: 160px; }
.footer-note { border-top: 1px solid rgba(255,255,255,.15); margin-top: 26px; padding-top: 18px; color: #93a29a; font-size: .82rem; }

/* ---------- cookie banner ---------- */
.cookie-banner {
  position: fixed; left: 16px; right: 16px; bottom: 16px; z-index: 100;
  max-width: 640px; margin: 0 auto;
  background: var(--card); color: var(--ink); border: 1px solid var(--line);
  border-radius: 12px; padding: 16px 18px; box-shadow: 0 8px 30px rgba(0,0,0,.18);
  display: none;
}
.cookie-banner.show { display: block; }
.cookie-banner p { margin: 0 0 12px; font-size: .9rem; }
.cookie-banner .actions { display: flex; gap: 10px; flex-wrap: wrap; }
.cookie-banner .actions button { flex: none; }

/* ---------- misc ---------- */
.tag-row { display: flex; gap: 8px; flex-wrap: wrap; margin: 18px 0 0; }
.tag { background: var(--accent-soft); color: var(--accent); border-radius: 999px;
  padding: 3px 12px; font-size: .8rem; font-weight: 600; text-decoration: none; }
.tag:hover { color: var(--accent-dark); }

.topic-strip { display: flex; gap: 10px; flex-wrap: wrap; margin: 6px 0 26px; }

@media (max-width: 720px) {
  .nav-toggle { display: block; }
  .site-nav { display: none; width: 100%; padding-bottom: 10px; }
  .site-nav.open { display: flex; flex-direction: column; align-items: stretch; }
  .site-nav.open a { padding: 11px 12px; }
  .site-nav.open a.lang-switch { margin-left: 0; text-align: center; }
  .hero { padding: 38px 0 44px; }
  .article { font-size: 16.5px; }
}

/* ============================================================
   WeddingKit — 12-month checklist, budget allocator & print sheet
   (site-specific additions below; shared components untouched)
   ============================================================ */

/* ---------- shared tool panel ---------- */
.tool-panel {
  background: var(--card); border: 1px solid var(--line);
  border-radius: var(--radius); padding: 22px; margin: 26px 0;
}
.tool-controls {
  display: grid; gap: 14px;
  grid-template-columns: repeat(auto-fit, minmax(170px, 1fr));
}
.tool-controls label {
  font-size: .82rem; font-weight: 700; text-transform: uppercase;
  letter-spacing: .05em; color: var(--muted);
  display: flex; flex-direction: column; gap: 6px;
}
.tool-controls input, .tool-controls select {
  padding: 10px 12px; border: 1px solid var(--line); border-radius: 8px;
  background: var(--bg); color: var(--ink); font-size: 1rem; font-weight: 400;
  text-transform: none; letter-spacing: 0;
}
.tool-controls input:focus, .tool-controls select:focus {
  outline: 2px solid var(--accent); outline-offset: 1px;
}
.tool-controls .check-line {
  flex-direction: row; align-items: center; gap: 8px;
  text-transform: none; letter-spacing: 0; font-size: .95rem;
  font-weight: 400; color: var(--ink);
}
.tool-controls .check-line input { width: 18px; height: 18px; accent-color: var(--accent); }
.tool-actions { display: flex; gap: 10px; margin-top: 16px; flex-wrap: wrap; }
.tool-status {
  margin: 14px 0 4px; font-weight: 700; color: var(--accent);
  font-size: 1.02rem;
}
.tool-status.ok { color: var(--ink); }
.tool-status.bad { color: #b00020; }

/* ---------- 12-month checklist ---------- */
.month-block {
  border: 1px solid var(--line); border-radius: 8px;
  padding: 14px 16px 10px; margin: 14px 0; background: var(--bg);
  break-inside: avoid;
}
.month-head {
  display: flex; align-items: baseline; gap: 12px; flex-wrap: wrap;
  border-bottom: 2px solid var(--accent-soft); padding-bottom: 6px;
}
.month-head h3 { margin: 0; font-size: 1.05rem; color: var(--brand-ink); }
.month-head .month-count {
  font-size: .82rem; color: var(--muted); font-weight: 600;
}
.task-list {
  list-style: none; margin: 8px 0 0; padding: 0;
  display: grid; grid-template-columns: repeat(auto-fill, minmax(290px, 1fr));
  gap: 3px 20px;
}
.task-item {
  display: flex; gap: 9px; align-items: flex-start;
  padding: 5px 6px; border-radius: 6px; break-inside: avoid;
}
.task-item:hover { background: var(--accent-soft); }
.task-item input[type="checkbox"] {
  margin-top: 5px; width: 16px; height: 16px; flex: none;
  accent-color: var(--accent); cursor: pointer;
}
.task-item label { cursor: pointer; line-height: 1.5; }
.task-item .note { display: block; font-size: .8rem; color: var(--muted); }
.task-item.done label { text-decoration: line-through; color: var(--muted); }
.progress-bar {
  height: 12px; border-radius: 999px; background: var(--accent-soft);
  border: 1px solid var(--line); overflow: hidden; margin: 8px 0 2px;
}
.progress-bar .fill {
  height: 100%; width: 0;
  background: linear-gradient(90deg, var(--champagne), var(--accent));
  transition: width .25s ease;
}

/* ---------- budget allocator ---------- */
.ba-section { margin: 20px 0; }
.ba-section > h3 {
  font-size: 1.02rem; color: var(--brand-ink);
  border-bottom: 2px solid var(--accent-soft); padding-bottom: 3px;
  margin: 18px 0 8px; break-after: avoid;
}
.ba-table { width: 100%; border-collapse: collapse; font-size: .95rem; }
.ba-table th, .ba-table td {
  border: 1px solid var(--line); padding: 7px 9px; text-align: left;
  vertical-align: middle;
}
.ba-table th { background: var(--accent-soft); font-weight: 700; }
.ba-table input[type="number"] {
  width: 84px; padding: 6px 8px; border: 1px solid var(--line);
  border-radius: 6px; background: var(--bg); color: var(--ink);
  font-size: .95rem;
}
.ba-table input[type="text"] {
  width: 100%; min-width: 120px; padding: 6px 8px; border: 1px solid var(--line);
  border-radius: 6px; background: var(--bg); color: var(--ink);
  font-size: .95rem;
}
.ba-table input[type="checkbox"] { width: 16px; height: 16px; accent-color: var(--accent); }
.ba-table .locked-row td { background: var(--accent-soft); }
.ba-total-row { font-weight: 800; }
.ba-total-row td { background: var(--accent-soft); }
.ba-result {
  border: 2px solid var(--accent); border-radius: 10px;
  background: var(--accent-soft); padding: 16px 18px; margin: 20px 0;
}
.ba-result .big {
  font-size: 1.9rem; font-weight: 800; color: var(--accent);
  line-height: 1.2;
}
.share-bar-row { display: flex; align-items: center; gap: 10px; margin: 6px 0; }
.share-bar-row .lbl { flex: none; width: 110px; font-size: .88rem; font-weight: 600; }
.share-bar-row .pct { flex: none; width: 52px; text-align: right; font-size: .88rem; color: var(--muted); }
.share-bar { flex: 1; height: 10px; border-radius: 999px; background: var(--card); border: 1px solid var(--line); overflow: hidden; }
.share-bar .fill { height: 100%; width: 0; background: var(--champagne); }
.share-bar.blush .fill { background: var(--accent); }
.ba-note { font-size: .85rem; color: var(--muted); }
.ba-warn {
  border: 1px solid var(--warn-line); background: var(--warn-bg);
  border-radius: 8px; padding: 12px 14px; margin: 14px 0; font-size: .95rem;
}
.ba-warn h4 { margin: 0 0 6px; font-size: 1rem; }
.ba-warn ul { margin: 0; padding-left: 1.3em; }
.print-sheet-head { display: none; }

/* ---------- print sheet (one clean page) ---------- */
@media print {
  .site-header, .site-footer, .cookie-banner, .ad-slot, .newsletter,
  .nav-toggle, .crumbs, .no-print { display: none !important; }
  body { background: #fff; color: #000; font-size: 10pt; }
  .wrap, .article { max-width: 100%; padding: 0; }
  .hero { background: none; color: #000; padding: 8px 0; }
  .hero h1 { color: #000; font-size: 18pt; }
  .hero p { color: #333; }
  .section { padding: 6px 0; }
  h2 { break-after: avoid; }
  table, .card, .month-block { break-inside: avoid; }
  a { color: #000; text-decoration: none; }
  .tool-panel { border: none; padding: 0; margin: 0; }
  .tool-controls, .tool-actions { display: none; }
  .tool-status { margin: 0 0 6px; font-size: 10pt; color: #000; }
  .month-block { border: none; padding: 4px 0 0; margin: 5px 0 0; }
  .month-head { border-bottom: 1px solid #999; padding-bottom: 2px; }
  .month-head h3 { font-size: 10.5pt; }
  .month-head .month-count { font-size: 8.5pt; }
  .task-list { grid-template-columns: 1fr 1fr; gap: 1px 16px; }
  .task-item { padding: 1px 0; }
  .task-item .note { display: none; }
  .task-item.done label { color: #000; }
  .progress-bar { display: none; }
  .ba-result { border-width: 1.5pt; }
  .ba-result .big { font-size: 16pt; }
  .print-sheet-head {
    display: block; margin: 0 0 4px; font-size: 9pt; color: #000;
    border-bottom: 1.5pt solid #000; padding-bottom: 3px;
  }
  .ba-note, .share-bar-row, .ba-warn { display: none; }
}
