/*
Theme Name: Alknooz Atlas
Theme URI: https://alknooz.com
Author: Alknooz
Description: A fast, image-free world directory theme: continents, countries, cities, universities, airports and more. Requires the Alknooz World Directory plugin.
Version: 1.0.0
Requires at least: 6.0
Requires PHP: 7.4
License: GPLv2 or later
Text Domain: alknooz-atlas
*/

:root {
	--paper: #f6f8f9;
	--panel: #ffffff;
	--ink: #1a2530;
	--muted: #5e6b78;
	--sea: #0f4c6e;
	--sea-deep: #0a3550;
	--marker: #e8b321;
	--line: #d9e1e7;
	--wash: #e9f0f4;
	--radius: 6px;
	--wrap: 72rem;
	--font: "Public Sans", system-ui, -apple-system, "Segoe UI", Roboto, Arial, sans-serif;
}

*, *::before, *::after { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; scroll-padding-top: 1rem; }

body {
	margin: 0;
	background: var(--paper);
	color: var(--ink);
	font: 400 1.0625rem/1.6 var(--font);
	font-variant-numeric: tabular-nums;
}

a { color: var(--sea); text-underline-offset: 0.18em; text-decoration-thickness: 1px; }
a:hover { color: var(--sea-deep); text-decoration-thickness: 2px; }
:focus-visible { outline: 3px solid var(--marker); outline-offset: 2px; border-radius: 2px; }

h1, h2, h3 { line-height: 1.2; margin: 0 0 0.6em; letter-spacing: -0.01em; }
h1 { font-size: clamp(2rem, 5vw, 3.4rem); font-weight: 800; letter-spacing: -0.025em; }
h2 { font-size: 1.5rem; font-weight: 800; }
h3 { font-size: 1.125rem; font-weight: 600; }
p { margin: 0 0 1em; max-width: 70ch; }

.skip { position: absolute; left: -999px; }
.skip:focus { left: 1rem; top: 1rem; background: var(--panel); padding: 0.5rem 1rem; z-index: 10; }

.wrap { max-width: var(--wrap); margin: 0 auto; padding: 0 1.25rem; }

/* Header */
.site-head { background: var(--panel); border-bottom: 1px solid var(--line); }
.site-head .wrap { display: flex; flex-wrap: wrap; align-items: center; gap: 0.75rem 1.5rem; padding-top: 0.9rem; padding-bottom: 0.9rem; }
.brand { font-weight: 800; font-size: 1.35rem; color: var(--ink); text-decoration: none; letter-spacing: -0.02em; }
.brand span { color: var(--sea); }
.continents-nav { display: flex; flex-wrap: wrap; gap: 0.25rem 1rem; margin: 0; padding: 0; list-style: none; font-size: 0.95rem; }
.continents-nav a { color: var(--muted); text-decoration: none; }
.continents-nav a:hover, .continents-nav a[aria-current] { color: var(--sea); text-decoration: underline; }
.head-search { margin-left: auto; }

.search-form { display: flex; gap: 0.4rem; }
.search-form input[type="search"] {
	font: inherit; font-size: 0.95rem; padding: 0.5rem 0.75rem; border: 1px solid var(--line);
	border-radius: var(--radius); background: var(--paper); min-width: 13rem; color: var(--ink);
}
.search-form button, .btn {
	font: inherit; font-size: 0.95rem; font-weight: 600; padding: 0.5rem 0.9rem; border-radius: var(--radius);
	border: 1px solid var(--sea); background: var(--sea); color: #fff; cursor: pointer;
}
.btn-quiet { background: transparent; color: var(--sea); padding: 0.2rem 0.6rem; font-size: 0.85rem; }
.btn-quiet[aria-expanded="true"] { background: var(--wash); }

/* Breadcrumbs */
.crumbs { font-size: 0.9rem; color: var(--muted); margin: 1.25rem 0 0.75rem; }
.crumbs ol { list-style: none; display: flex; flex-wrap: wrap; gap: 0.35rem; margin: 0; padding: 0; }
.crumbs li + li::before { content: "/"; margin-right: 0.35rem; color: var(--line); }

/* The plate: the one bold element of every location page */
.plate {
	background: var(--sea);
	color: #fff;
	border-radius: var(--radius);
	padding: clamp(1.5rem, 4vw, 2.75rem);
	margin-bottom: 2rem;
	position: relative;
	overflow: hidden;
}
.plate::after { /* survey grid drawn in CSS, no images */
	content: ""; position: absolute; inset: 0; pointer-events: none;
	background-image: linear-gradient(rgba(255,255,255,.07) 1px, transparent 1px), linear-gradient(90deg, rgba(255,255,255,.07) 1px, transparent 1px);
	background-size: 48px 48px;
}
.plate > * { position: relative; z-index: 1; }
.plate h1 { color: #fff; margin-bottom: 0.35rem; }
.plate .kind { color: #cfe0ea; font-size: 1rem; margin: 0 0 0.4rem; }
.plate .coords { color: var(--marker); font-weight: 600; font-size: 1.05rem; margin: 0; display: flex; flex-wrap: wrap; gap: 0.25rem 1.5rem; }
.plate a { color: #fff; }

/* Location page layout */
.layout { display: grid; grid-template-columns: 13rem minmax(0, 1fr); gap: 2.5rem; align-items: start; }
.toc { position: sticky; top: 1rem; font-size: 0.93rem; }
.toc h2 { font-size: 0.95rem; color: var(--muted); font-weight: 600; margin-bottom: 0.5rem; }
.toc ul { list-style: none; margin: 0; padding: 0; border-left: 2px solid var(--line); }
.toc li a { display: flex; justify-content: space-between; gap: 0.5rem; padding: 0.25rem 0 0.25rem 0.85rem; color: var(--ink); text-decoration: none; }
.toc li a:hover { color: var(--sea); background: var(--wash); }
.toc .n { color: var(--muted); }

.sec { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); padding: 1.5rem; margin-bottom: 1.5rem; }
.sec > h2 { display: flex; align-items: baseline; gap: 0.6rem; }
.sec > h2 .n { font-size: 1rem; color: var(--muted); font-weight: 600; }
.source { font-size: 0.85rem; color: var(--muted); }
.empty { color: var(--muted); font-style: italic; }

/* Facts */
.facts { display: grid; grid-template-columns: repeat(auto-fill, minmax(15rem, 1fr)); gap: 0; margin: 0; }
.facts div { border-top: 1px solid var(--line); padding: 0.65rem 0.75rem 0.65rem 0; }
.facts dt { font-size: 0.85rem; color: var(--muted); }
.facts dd { margin: 0; font-weight: 600; }

/* Climate: 12 bars drawn with CSS */
.climate { display: grid; grid-template-columns: repeat(12, minmax(0, 1fr)); gap: 0.35rem; align-items: end; margin: 1rem 0 0.5rem; }
.climate .m { text-align: center; font-size: 0.78rem; }
.climate .bar { height: 7rem; display: flex; align-items: flex-end; justify-content: center; }
.climate .bar span { display: block; width: 70%; min-height: 3px; height: var(--h); background: var(--sea); border-radius: 3px 3px 0 0; }
.climate .bar span.hot { background: #b8561a; }
.climate .bar span.warm { background: #d0902a; }
.climate .bar span.cold { background: #6d9bb8; }
.climate .hi { font-weight: 600; display: block; }
.climate .lo, .climate .rain { color: var(--muted); display: block; }
.climate-table { width: 100%; border-collapse: collapse; font-size: 0.9rem; margin-top: 1rem; }
.climate-table th, .climate-table td { padding: 0.35rem 0.5rem; border-bottom: 1px solid var(--line); text-align: left; }
.scroll { overflow-x: auto; }

/* Lists */
.cols { columns: 3 14rem; column-gap: 2rem; margin: 0; padding: 0; list-style: none; }
.cols li { break-inside: avoid; padding: 0.2rem 0; }
.cols .n { color: var(--muted); font-size: 0.85rem; margin-left: 0.3rem; }

.kv { width: 100%; border-collapse: collapse; }
.kv th, .kv td { text-align: left; padding: 0.55rem 0.5rem 0.55rem 0; border-bottom: 1px solid var(--line); vertical-align: top; }
.kv th { font-weight: 400; color: var(--muted); width: 38%; }
.kv td { font-weight: 600; word-break: break-word; }
.phone { font-size: 1.25rem; font-weight: 800; color: var(--ink); }

.apps { display: grid; grid-template-columns: repeat(auto-fill, minmax(14rem, 1fr)); gap: 1rem 2rem; }
.apps h3 { font-size: 0.95rem; color: var(--muted); margin-bottom: 0.25rem; }
.apps p { margin: 0; font-weight: 600; }

.places { list-style: none; margin: 0; padding: 0; }
.places > li { border-top: 1px solid var(--line); padding: 0.75rem 0; }
.places .row { display: flex; flex-wrap: wrap; align-items: baseline; gap: 0.3rem 0.75rem; }
.places .name { font-weight: 600; }
.places .meta { color: var(--muted); font-size: 0.9rem; }
.places .map-slot iframe { margin-top: 0.75rem; }

.map { width: 100%; aspect-ratio: 16 / 9; border: 1px solid var(--line); border-radius: var(--radius); display: block; background: var(--wash); }

/* Home */
.home-hero { padding: clamp(2.5rem, 7vw, 5rem) 0 2rem; }
.home-hero h1 { max-width: 18ch; }
.home-hero p { font-size: 1.2rem; color: var(--muted); max-width: 52ch; }
.home-hero .search-form input[type="search"] { font-size: 1.05rem; padding: 0.75rem 1rem; min-width: min(28rem, 60vw); background: var(--panel); }
.home-hero .search-form button { font-size: 1.05rem; padding: 0.75rem 1.2rem; }
.stats { display: flex; flex-wrap: wrap; gap: 0.5rem 2rem; margin-top: 1.5rem; color: var(--muted); }
.stats strong { color: var(--ink); font-size: 1.15rem; }

.continent-block { border-top: 3px solid var(--sea); padding: 1.5rem 0 2rem; }
.continent-block h2 a { color: var(--ink); text-decoration: none; }
.continent-block h2 a:hover { color: var(--sea); }

.country-table { width: 100%; border-collapse: collapse; background: var(--panel); border: 1px solid var(--line); }
.country-table th, .country-table td { text-align: left; padding: 0.6rem 0.8rem; border-bottom: 1px solid var(--line); }
.country-table th { font-size: 0.85rem; color: var(--muted); font-weight: 600; background: var(--wash); }

/* Footer */
.site-foot { margin-top: 4rem; border-top: 1px solid var(--line); background: var(--panel); padding: 2rem 0; font-size: 0.88rem; color: var(--muted); }
.site-foot p { max-width: none; }

.notice-box { background: #fff7e0; border: 1px solid var(--marker); padding: 1rem 1.25rem; border-radius: var(--radius); margin: 2rem 0; }

@media (max-width: 860px) {
	.layout { grid-template-columns: 1fr; gap: 1rem; }
	.toc { position: static; }
	.toc ul { display: flex; gap: 0.25rem 0.5rem; overflow-x: auto; border-left: 0; padding-bottom: 0.25rem; }
	.toc li a { white-space: nowrap; border: 1px solid var(--line); border-radius: 999px; padding: 0.2rem 0.7rem; background: var(--panel); }
	.head-search { margin-left: 0; width: 100%; }
	.head-search input[type="search"] { flex: 1; min-width: 0; }
	.climate .lo, .climate .rain { display: none; }
	.sec { padding: 1.1rem; }
}

@media (prefers-reduced-motion: reduce) {
	* { scroll-behavior: auto !important; transition: none !important; }
}
