/* Traveltopics.org starter
   Goal: clean, fast, consistent, easy to expand
*/

:root{
  /* Theme */
  --bg:#3A4A3C;
  --bg-rgb:58,74,60;

  --panel:#5A4F3B;
  --panel-rgb:90,79,59;

  --panel2:#4F4635;
  --panel2-rgb:79,70,53;

  --text:#F0EAD6;
  --text-rgb:240,234,214;

  /* Brighter “muted” so small text stays readable */
  --muted:#E5F4EB;

  --brand:#6E7F5E;
  --brand-rgb:110,127,94;

  --brand2:#A4B394;
  --brand2-rgb:164,179,148;

  --accent:#6E7F5E;
  --accent-rgb:110,127,94;

  --link:#E7F3D5;

  --border:rgba(240,234,214,.18);
  --shadow:0 10px 30px rgba(0,0,0,.25);
  --radius:18px;
  --max:1100px;

  /* Fonts */
  --mono: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace;
  --sans: system-ui, -apple-system, Segoe UI, Roboto, Arial, Helvetica, sans-serif;
  --display: "Dancing Script", cursive;
}

*{box-sizing:border-box}
html,body{height:100%}
body{
  margin:0;
  font-family:var(--sans);
  background: var(--bg);
color:var(--text);
}

a{color:var(--link); text-decoration:none}
a:hover{text-decoration:underline}

.wrap{max-width:var(--max); margin:0 auto; padding:18px}
.card{
  background: linear-gradient(180deg, rgba(var(--panel-rgb), .95), rgba(var(--panel-rgb), .82));
border:1px solid var(--border);
  border-radius:var(--radius);
  box-shadow:var(--shadow);
  overflow:hidden;
}

header.site-header{
  position:sticky;
  top:0;
  z-index:50;
  backdrop-filter: blur(10px);
  background: rgba(var(--bg-rgb), .86);
  border-bottom:1px solid var(--border);
}
.header-inner{
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:16px;
  max-width:var(--max);
  margin:0 auto;
  padding:14px 18px;
}
.brand{
  display:flex;
  align-items:baseline;
  gap:10px;
}
.brand a{
  display:inline-flex;
  align-items:baseline;
  gap:10px;
  text-decoration:none;
}
.brand h1{
  margin:0;
  font-family:var(--display);
  font-size:clamp(28px, 3.2vw, 52px);
  font-weight:700;
  letter-spacing:.15px;
  line-height:1.05;
  white-space:nowrap;
  color:var(--text);
  -webkit-text-stroke:0.6px rgba(0,0,0,.35);
  text-shadow:3px 3px 4px rgba(0,0,0,.35);
}
.brand .tag{
  color:var(--muted);
  font-size:12px;
  font-weight:600;
  letter-spacing:.25px;
}

nav.top-nav{
  display:flex;
  align-items:center;
  gap:10px;
  flex-wrap:wrap;
}
nav.top-nav a{
  display:inline-flex;
  align-items:center;
  gap:8px;
  padding:8px 10px;
  border:1px solid var(--border);
  border-radius:12px;
  color:var(--text);
  background: rgba(var(--panel-rgb),.55);
}
nav.top-nav a.active{
  border-color: rgba(var(--brand2-rgb), .55);
  box-shadow: 0 0 0 2px rgba(var(--brand2-rgb),.15) inset;
}
nav.top-nav a:hover{background: rgba(var(--panel-rgb),.9); text-decoration:none}

.lang{
  display:flex;
  gap:6px;
  align-items:center;
}
.lang button{
  border:1px solid var(--border);
  background: rgba(var(--panel-rgb),.55);
  color:var(--text);
  padding:7px 9px;
  border-radius:10px;
  cursor:pointer;
  font-weight:700;
  font-size:12px;
}
.lang button[aria-current="true"]{
  border-color: rgba(var(--brand2-rgb), .55);
  box-shadow: 0 0 0 2px rgba(var(--brand2-rgb),.15) inset;
}
.lang button:disabled{
  opacity:.55;
  cursor:not-allowed;
}

.hero{
  padding:22px 22px 10px 22px;
}
.hero h2{margin:0 0 10px 0; font-size:28px}
.hero p{margin:0 0 10px 0; color:var(--muted); line-height:1.45}
.pills{display:flex; flex-wrap:wrap; gap:8px; margin-top:10px}
.pill{
  font-size:12px;
  font-weight:700;
  padding:6px 10px;
  border-radius:999px;
  border:1px solid var(--border);
  background: rgba(var(--panel-rgb),.55);
  color:var(--text);
}

.grid{
  display:grid;
  grid-template-columns: repeat(12, 1fr);
  gap:14px;
  padding:18px 22px 22px 22px;
}
.col-12{grid-column: span 12}
.col-8{grid-column: span 8}
.col-6{grid-column: span 6}
.col-4{grid-column: span 4}
.col-3{grid-column: span 3}

@media (max-width: 860px){
  .col-8,.col-6,.col-4,.col-3{grid-column: span 12}
  .header-inner{flex-direction:column; align-items:flex-start}
  nav.top-nav{width:100%}
}

.section-title{
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:12px;
  margin:0 0 8px 0;
}
.section-title h3{
  margin:0;
  font-size:18px;
  font-weight:900;
}
.kicker{
  color:var(--muted);
  font-size:13px;
  line-height:1.5;
}

.panel{
  padding:16px;
  border:1px solid var(--border);
  border-radius:16px;
  background: rgba(var(--panel-rgb),.55);
}
.table{
  width:100%;
  border-collapse:collapse;
  overflow:hidden;
  border-radius:14px;
  border:1px solid var(--border);
}
.table th, .table td{
  padding:10px 10px;
  border-bottom:1px solid var(--border);
  text-align:left;
  vertical-align:top;
}
.table th{
  background: rgba(var(--accent-rgb),.45);
  font-weight:900;
}
.table tr:last-child td{border-bottom:none}
.small{font-size:12px; color:var(--muted)}
.mono{font-family:var(--mono)}

.actions{
  display:flex;
  gap:8px;
  flex-wrap:wrap;
}
.btn{
  border:1px solid var(--border);
  background: rgba(var(--panel-rgb),.65);
  color:var(--text);
  padding:8px 10px;
  border-radius:12px;
  cursor:pointer;
  font-weight:800;
  font-size:13px;
}
.btn:hover{background: rgba(var(--panel-rgb),.95)}
.btn.primary{
  border-color: rgba(var(--brand2-rgb), .55);
  box-shadow: 0 0 0 2px rgba(var(--brand2-rgb),.15) inset;
}

.copyblock{
  border:1px solid var(--border);
  border-radius:16px;
  overflow:hidden;
  background: rgba(var(--panel-rgb),.45);
}
.copyblock .copyhead{
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:12px;
  padding:12px 12px;
  background: rgba(var(--accent-rgb),.35);
  border-bottom:1px solid var(--border);
}
.copyblock .copyhead h4{
  margin:0;
  font-size:15px;
  font-weight:900;
}
.copyblock pre{
  margin:0;
  padding:12px;
  white-space:pre-wrap;
  line-height:1.45;
  font-family:var(--mono);
  font-size:13px;
}

.notice{
  border-left:4px solid rgba(var(--brand2-rgb),.55);
  padding:10px 12px;
  background: rgba(var(--panel-rgb),.55);
  border-radius:12px;
  color:var(--muted);
  line-height:1.5;
}

.footer{
  max-width:var(--max);
  margin:18px auto 30px auto;
  padding:0 18px;
  color:var(--muted);
  font-size:12px;
  line-height:1.6;
}
.footer a{color:var(--muted); text-decoration:underline}

.search{
  display:flex;
  gap:10px;
  flex-wrap:wrap;
  align-items:center;
}
.search input{
  flex:1 1 260px;
  min-width:240px;
  padding:10px 12px;
  border-radius:12px;
  border:1px solid var(--border);
  background: rgba(var(--panel-rgb),.55);
  color:var(--text);
}
.search input::placeholder{color: rgba(var(--text-rgb),.55)}
.badge{
  display:inline-flex;
  gap:6px;
  align-items:center;
  padding:6px 9px;
  border:1px solid var(--border);
  border-radius:999px;
  background: rgba(var(--panel-rgb),.55);
  font-size:12px;
  font-weight:800;
  color:var(--muted);
}
.country-list{
  display:grid;
  grid-template-columns: repeat(12, 1fr);
  gap:12px;
}
.country-item{
  grid-column: span 4;
  padding:14px;
  border-radius:16px;
  border:1px solid var(--border);
  background: rgba(var(--panel-rgb),.55);
}
.country-item h4{
  margin:0 0 6px 0;
  font-size:16px;
  font-weight:900;
}
.country-item p{
  margin:0;
  color:var(--muted);
  font-size:13px;
  line-height:1.4;
}
@media (max-width: 860px){
  .country-item{grid-column: span 12}
}
.ad-slot{
  border:1px dashed var(--border);
  background: rgba(var(--panel-rgb),.35);
  border-radius:16px;
  padding:14px;
  color:rgba(var(--text-rgb),.65);
  font-size:12px;
}
/* ----- Cleanups / uniform helpers ----- */
.footer-inner{padding:0}
.footer-inner .small + .small{margin-top:8px}

/* Country directory */
.country-tags{
  margin-top:10px;
  display:flex;
  gap:8px;
  flex-wrap:wrap;
}
#countryList{margin-top:12px}

/* Country playbook (Spain template) */
.copygrid{
  display:grid;
  grid-template-columns:repeat(12, 1fr);
  gap:12px;
}
.copygrid .copyblock{grid-column: span 6}
@media (max-width: 860px){
  .copygrid .copyblock{grid-column: span 12}
}
.howto-item{margin-bottom:10px}
.itinerary{margin:10px 0; background: rgba(var(--panel-rgb), .35)}
.section-title-tight{margin:0 0 6px 0}
.h3-tight{font-size:16px; margin:0}
.kicker-tight{margin:0; padding-left:18px}

/* Toast */
.toast{
  position:fixed;
  right:16px;
  bottom:16px;
  padding:10px 12px;
  border:1px solid var(--border);
  background: rgba(var(--panel-rgb), .92);
  color:var(--text);
  border-radius:12px;
  box-shadow:var(--shadow);
  z-index:9999;
  font-weight:800;
  font-size:13px;
  opacity:0;
  transform: translateY(6px);
  pointer-events:none;
  transition: opacity .2s ease, transform .2s ease;
}
.toast.show{
  opacity:1;
  transform:none;
}

.country-list + .small{margin-top:12px}

/* =============================== */
/*        ITINERARY BUILDER        */
/* =============================== */
.builder .form-grid{
  display:grid;
  grid-template-columns: repeat(12, 1fr);
  gap:12px;
}
.builder .field{grid-column: span 6}
.builder .field.full{grid-column: span 12}
.builder label{
  display:block;
  font-weight:900;
  font-size:12px;
  letter-spacing:.2px;
  color:var(--muted);
  margin:0 0 6px 0;
}
.builder input,
.builder select,
.builder textarea{
  width:100%;
  padding:10px 12px;
  border-radius:12px;
  border:1px solid var(--border);
  background: rgba(var(--panel-rgb),.55);
  color:var(--text);
  font-family:var(--sans);
}
.builder textarea{min-height:88px; resize:vertical}
.builder input::placeholder,
.builder textarea::placeholder{color: rgba(var(--text-rgb),.55)}

.day-card{
  border:1px solid var(--border);
  border-radius:16px;
  background: rgba(var(--panel-rgb),.45);
  padding:12px;
}
.day-head{
  display:flex;
  align-items:flex-end;
  justify-content:space-between;
  gap:10px;
  margin-bottom:10px;
}
.day-head .day-title{
  flex:1;
}
.day-head .day-title input{font-weight:900}
.item-card{
  border:1px solid var(--border);
  border-radius:14px;
  padding:10px;
  background: rgba(var(--panel2-rgb),.35);
  margin-top:10px;
}
.item-grid{
  display:grid;
  grid-template-columns: 120px 170px 1fr 150px;
  gap:10px;
}
.item-grid .span-2{grid-column: span 2}
.item-grid .full{grid-column: 1 / -1}
.item-actions{
  display:flex;
  justify-content:flex-end;
  gap:8px;
  margin-top:10px;
}
.totals-grid{
  display:grid;
  grid-template-columns: repeat(12, 1fr);
  gap:12px;
}
.totals-grid .panel{grid-column: span 6}

@media (max-width: 860px){
  .builder .field{grid-column: span 12}
  .item-grid{grid-template-columns: 1fr;}
  .totals-grid .panel{grid-column: span 12}
}
