/* Ferieguiden.no — moderne stil. Beholder marineblå + sol-oransje fra original.
   Ingen runtime-bibliotek. Ren CSS, mobil-først. */

:root {
  --navy: #000084;
  --navy-700: #00006a;
  --navy-50: #eef0ff;
  --sun: #f97316;
  --sun-50: #fff4e8;
  --sun-100: #ffe2c2;
  --gold: #fbbf24;
  --rust: #af4d3f;
  --bg: #fffaf3;
  --surface: #ffffff;
  --ink: #0f172a;
  --muted: #475569;
  --line: #e6e3dc;
  --shadow-sm: 0 1px 2px rgba(15,23,42,.06), 0 1px 1px rgba(15,23,42,.04);
  --shadow-md: 0 6px 24px -8px rgba(15,23,42,.18), 0 2px 4px rgba(15,23,42,.06);
  --shadow-lg: 0 24px 60px -20px rgba(0,0,132,.25), 0 8px 24px -12px rgba(15,23,42,.12);
  --radius: 14px;
  --radius-lg: 22px;
}

* { box-sizing: border-box; min-width: 0; }

html { scroll-behavior: smooth; overflow-x: hidden; }
body {
  margin: 0;
  font-family: 'Inter', system-ui, -apple-system, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
  font-size: 17px;
  line-height: 1.65;
  color: var(--ink);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  overflow-x: hidden;
}

a { color: var(--navy); text-decoration: none; }
a:hover { color: var(--sun); }
img { max-width: 100%; height: auto; display: block; }

h1, h2, h3, h4 { font-family: 'Lora', Georgia, serif; color: var(--ink); margin: 0 0 .5em; line-height: 1.2; letter-spacing: -.01em; }
h1 { font-size: clamp(2rem, 4.2vw, 3.2rem); }
h2 { font-size: clamp(1.5rem, 2.5vw, 2.1rem); }
h3 { font-size: 1.25rem; }
p  { margin: 0 0 1em; }

.container {
  width: min(1200px, calc(100% - 2rem));
  max-width: 100%;
  margin: 0 auto;
}
.container-narrow { width: min(820px, calc(100% - 2rem)); max-width: 100%; margin: 0 auto; }

/* === Top bar === */
.topbar {
  position: sticky; top: 0; z-index: 50;
  background: var(--navy);
  color: #fff;
  box-shadow: var(--shadow-md);
}
.topbar-inner {
  display: flex; align-items: center; gap: 1.25rem;
  padding: .85rem 0;
}
.topbar a { color: #fff; }
.topbar a:hover { color: var(--gold); }
.brand { display: inline-flex; align-items: center; gap: .6rem; }
.brand-logo { height: 38px; width: auto; }
.brand-tagline { display: none; font-size: .85rem; color: #ffe2c2; opacity: .9; margin-left: .5rem; }
@media (min-width: 980px) { .brand-tagline { display: inline; } }

.nav { display: flex; gap: 1.1rem; flex: 1; flex-wrap: wrap; align-items: center; }
.nav a { font-size: .95rem; font-weight: 500; opacity: .92; padding: .25rem 0; }
.nav a:hover { opacity: 1; }

.nav-toggle {
  background: transparent; border: 1px solid rgba(255,255,255,.25);
  color: #fff; padding: .35rem .65rem; border-radius: 8px; cursor: pointer;
  display: inline-flex; align-items: center; gap: .35rem; font: inherit; font-size: .9rem;
}
@media (min-width: 880px) { .nav-toggle { display: none; } }
@media (max-width: 879px) {
  .nav { display: none; }
  .nav.open { display: flex; flex-direction: column; align-items: flex-start; padding-top: .75rem; gap: .35rem; flex-basis: 100%; }
}

/* === Hero (front page) === */
.hero {
  position: relative;
  background: linear-gradient(135deg, var(--navy) 0%, #0c1582 50%, #1c2a99 100%);
  color: #fff;
  padding: 4rem 0 5rem;
  overflow: hidden;
}
.hero::before {
  content: ""; position: absolute; right: -120px; top: -120px; width: 460px; height: 460px;
  border-radius: 50%; background: radial-gradient(circle, rgba(251,191,36,.55) 0%, rgba(249,115,22,.25) 45%, transparent 70%);
  filter: blur(2px);
}
.hero h1 { color: #fff; max-width: 22ch; overflow-wrap: break-word; word-wrap: break-word; hyphens: auto; }
.hero .sub { font-size: clamp(1.05rem, 1.6vw, 1.2rem); color: #ffe2c2; max-width: 60ch; margin-bottom: 1.6rem; overflow-wrap: break-word; }

.hero-search {
  display: flex; gap: .35rem; max-width: 720px; background: #fff; border-radius: var(--radius);
  padding: .3rem; box-shadow: var(--shadow-lg); width: 100%;
}
.hero-search input {
  flex: 1 1 0; min-width: 0;
  border: 0; padding: .85rem .9rem; font: inherit; font-size: 1rem; background: transparent; outline: none; color: var(--ink);
}
.hero-search button {
  background: var(--sun); color: #fff; border: 0; padding: .75rem 1.1rem; border-radius: 10px; font-weight: 600; cursor: pointer;
  font-size: .95rem; flex-shrink: 0; display: inline-flex; align-items: center; gap: .35rem;
}
.hero-search button .ico { width: 18px; height: 18px; }
.hero-search button:hover { background: #ea580c; }
@media (max-width: 560px) {
  .hero-search button .label { display: none; }
  .hero-search button { padding: .75rem .85rem; }
  .hero-search input { padding-left: .75rem; }
  .hero-search input::placeholder { font-size: .85rem; }
}

.quick-pills { margin-top: 1.2rem; display: flex; flex-wrap: wrap; gap: .45rem; }
.quick-pills a { background: rgba(255,255,255,.12); padding: .35rem .8rem; border-radius: 999px; color: #fff; font-size: .88rem; }
.quick-pills a:hover { background: rgba(255,255,255,.22); color: var(--gold); }

/* === Section helpers === */
section.block { padding: 3rem 0; }
.section-head { display: flex; justify-content: space-between; align-items: end; margin-bottom: 1.5rem; gap: 1rem; flex-wrap: wrap; }
.section-head h2 { margin-bottom: 0; }
.section-head .more { font-size: .95rem; color: var(--navy); font-weight: 600; }
.section-head .more:hover { color: var(--sun); }

/* === Cards / grids === */
.grid { display: grid; gap: 1.1rem; }
.grid.cols-2 { grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); }
.grid.cols-3 { grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); }
.grid.cols-4 { grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); }

.card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  overflow: hidden;
  transition: transform .2s ease, box-shadow .2s ease, border-color .2s;
  display: flex; flex-direction: column;
}
.card:hover { transform: translateY(-2px); box-shadow: var(--shadow-md); border-color: #d8d4cb; }
.card-img { aspect-ratio: 16/10; background: linear-gradient(135deg, #cbd5e1 0%, #e2e8f0 100%); object-fit: cover; }
.card-body { padding: 1rem 1.1rem 1.2rem; }
.card-eyebrow { font-size: .78rem; text-transform: uppercase; letter-spacing: .08em; color: var(--rust); font-weight: 600; }
.card h3 { font-family: 'Inter', sans-serif; font-size: 1.1rem; font-weight: 700; margin: .25rem 0 .35rem; }
.card p { font-size: .92rem; color: var(--muted); margin-bottom: 0; }

/* === Continent grid === */
.continent-grid {
  display: grid; gap: 1rem;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
}
.continent-card {
  position: relative; aspect-ratio: 4/3; border-radius: var(--radius); overflow: hidden;
  background: var(--navy); color: #fff; display: flex; align-items: end; padding: 1.2rem;
}
.continent-card .bg { position: absolute; inset: 0; opacity: .55; transition: opacity .3s, transform .3s; object-fit: cover; }
.continent-card::after { content:""; position:absolute; inset:0; background: linear-gradient(to top, rgba(0,0,132,.85) 0%, rgba(0,0,132,.15) 60%, transparent 100%); }
.continent-card .label { position: relative; z-index: 1; }
.continent-card .name { font-family: 'Lora', serif; font-size: 1.55rem; font-weight: 700; }
.continent-card .count { font-size: .85rem; opacity: .9; }
.continent-card:hover .bg { opacity: .8; transform: scale(1.04); }

/* === Country page hero === */
.country-hero {
  position: relative;
  height: clamp(280px, 40vh, 460px);
  color: #fff;
  overflow: hidden;
  background: var(--navy);
}
.country-hero img.bg { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; opacity: .85; }
.country-hero::after { content:""; position:absolute; inset:0; background: linear-gradient(to bottom, rgba(0,0,90,.25) 0%, rgba(0,0,90,.85) 100%); }
.country-hero-inner { position: relative; z-index: 1; padding: 2rem 0; height:100%; display: flex; flex-direction: column; justify-content: end; }
.country-hero h1 { color: #fff; margin-bottom: .25rem; }
.country-hero .meta { font-size: 1rem; color: #ffe2c2; }
.country-hero .flag { width: 56px; height: 38px; border-radius: 4px; box-shadow: 0 2px 6px rgba(0,0,0,.3); object-fit: cover; margin-right: .65rem; vertical-align: middle; }

/* === Breadcrumbs === */
.crumbs { font-size: .9rem; color: var(--muted); padding: .9rem 0; }
.crumbs a { color: var(--muted); }
.crumbs a:hover { color: var(--navy); }
.crumbs .sep { margin: 0 .35rem; opacity: .5; }
.country-hero .crumbs, .country-hero .crumbs a { color: #ffe2c2; }

/* === Quick facts === */
.facts {
  display: grid; gap: 1rem; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 1.2rem;
  box-shadow: var(--shadow-sm);
}
.fact .label { font-size: .78rem; text-transform: uppercase; letter-spacing: .08em; color: var(--muted); margin-bottom: .15rem; }
.fact .value { font-weight: 600; color: var(--ink); }

/* === Article body === */
.article {
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius);
  padding: clamp(1.5rem, 4vw, 2.5rem); margin-top: -3rem; position: relative; z-index: 2;
  box-shadow: var(--shadow-md);
}
.article h2 { margin-top: 1.8em; }
.article h2:first-child { margin-top: 0; }
.article p, .article li { font-size: 1.04rem; }
.article ul { padding-left: 1.2rem; }
.article ul li { margin-bottom: .35rem; }
.article blockquote {
  border-left: 4px solid var(--sun); margin: 1.5rem 0; padding: .25rem 1.2rem; color: var(--muted); font-style: italic;
}

/* === Subpage navigation (per land) === */
.subnav {
  display: grid; gap: .55rem; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  background: var(--navy-50); border: 1px solid #d3d8ff; border-radius: var(--radius);
  padding: 1rem; margin: 2rem 0;
}
.subnav a {
  display: flex; align-items: center; gap: .55rem; padding: .55rem .8rem;
  background: var(--surface); border: 1px solid var(--line); border-radius: 10px;
  font-size: .92rem; color: var(--navy); font-weight: 500;
}
.subnav a:hover { border-color: var(--sun); background: var(--sun-50); }
.subnav a.current { background: var(--navy); color: #fff; border-color: var(--navy); }
.subnav a .ico { width: 18px; height: 18px; opacity: .9; }

/* === Footer === */
footer {
  background: var(--navy); color: #cdd1ff; padding: 3rem 0 1.5rem; margin-top: 4rem;
}
footer a { color: #fff; }
footer a:hover { color: var(--gold); }
footer .footer-grid { display: grid; gap: 2rem; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); }
footer h4 { color: #fff; font-family: 'Inter', sans-serif; font-size: .85rem; text-transform: uppercase; letter-spacing: .1em; margin-bottom: .8rem; }
footer ul { list-style: none; padding: 0; margin: 0; }
footer li { margin-bottom: .35rem; font-size: .92rem; }
footer .legal { margin-top: 2.5rem; padding-top: 1.5rem; border-top: 1px solid rgba(255,255,255,.15); font-size: .85rem; color: #aab0e8; display: flex; justify-content: space-between; flex-wrap: wrap; gap: 1rem; }

/* === Search results page === */
.search-results .result {
  padding: 1rem 0; border-bottom: 1px solid var(--line);
}
.search-results .result a { font-weight: 600; font-size: 1.1rem; }
.search-results .result .snippet { font-size: .92rem; color: var(--muted); margin-top: .2rem; }
.search-results .result .crumb { font-size: .8rem; color: var(--rust); }

/* === Misc === */
.btn {
  display: inline-flex; align-items: center; gap: .5rem; background: var(--sun); color: #fff; padding: .7rem 1.2rem;
  border-radius: 10px; font-weight: 600; box-shadow: var(--shadow-sm); border: 0; cursor: pointer; font: inherit; font-size: .95rem;
}
.btn:hover { background: #ea580c; color: #fff; }
.btn-secondary { background: var(--surface); color: var(--navy); border: 1px solid var(--line); }
.btn-secondary:hover { background: var(--navy-50); color: var(--navy); }

.badge {
  display: inline-block; padding: .15rem .6rem; border-radius: 999px; background: var(--navy-50); color: var(--navy);
  font-size: .78rem; font-weight: 600;
}
.badge-sun { background: var(--sun-100); color: #9a3412; }

/* Small utilities */
.muted { color: var(--muted); }
.text-center { text-align: center; }
.lead { font-size: 1.1rem; color: var(--muted); }
.divider { height: 1px; background: var(--line); margin: 2rem 0; border: 0; }

@media (max-width: 600px) {
  body { font-size: 16px; }
  h1 { font-size: clamp(1.6rem, 7vw, 2.2rem); }
  h2 { font-size: clamp(1.2rem, 5vw, 1.6rem); }
  .hero { padding: 2rem 0 2.5rem; }
  .hero .sub { font-size: 1rem; }
  .article { margin-top: -1.5rem; padding: 1.1rem; border-radius: 12px; }
  .container, .container-narrow { width: calc(100% - 1rem); }
  .topbar-inner { padding: .65rem 0; gap: .5rem; }
  .brand-logo { height: 32px; }
  .quick-pills { gap: .35rem; }
  .quick-pills a { font-size: .82rem; padding: .3rem .65rem; }
  .country-hero { height: clamp(220px, 38vh, 360px); }
  .country-hero h1 { font-size: clamp(1.6rem, 7vw, 2.2rem); }
  .country-hero .meta { font-size: .85rem; }
  .country-hero .flag { width: 36px; height: 26px; margin-right: .5rem; }
  .facts { padding: .9rem; gap: .65rem; grid-template-columns: repeat(2, 1fr); }
  .fact .label { font-size: .7rem; }
  .fact .value { font-size: .9rem; }
  .subnav { grid-template-columns: 1fr; padding: .65rem; gap: .35rem; }
  .subnav a { padding: .6rem .75rem; font-size: .92rem; }
  .grid.cols-3, .grid.cols-2, .grid.cols-4 { grid-template-columns: 1fr; }
  .continent-grid { grid-template-columns: 1fr; }
  .continent-card { aspect-ratio: 16/9; padding: 1rem; }
  .continent-card .name { font-size: 1.3rem; }
  .crumbs { font-size: .82rem; padding: .65rem 0; }
  .section-head { flex-direction: column; align-items: flex-start; gap: .25rem; }
  footer { padding: 2rem 0 1rem; }
  footer .footer-grid { gap: 1.25rem; }
  footer .legal { flex-direction: column; gap: .35rem; }
}

@media (max-width: 380px) {
  .nav-toggle { padding: .3rem .55rem; font-size: .82rem; }
  .brand-tagline { display: none !important; }
  .article p, .article li { font-size: .98rem; }
}

/* Always-on safety: prevent any single image/element from forcing horizontal scroll */
img, video, iframe, table, pre { max-width: 100%; }
.article > * { max-width: 100%; }
.article ul { padding-left: 1rem; }

/* Print */
@media print {
  .topbar, footer, .subnav, .hero-search, .quick-pills { display: none; }
  body { background: #fff; }
  .article { box-shadow: none; border: 0; padding: 0; }
}
