/*
Theme Name: TaxiAk
Theme URI: https://www.taxiak.is
Author: TaxiAk
Description: Theme for TaxiAk, Akureyri. Destinations with date booking, "Book a Taxi Now" pickup requests with GPS location, English/Icelandic, and a Bookings inbox in WP admin.
Version: 1.7.1
Requires at least: 6.2
Requires PHP: 7.4
License: GNU General Public License v2 or later
License URI: https://www.gnu.org/licenses/gpl-2.0.html
Text Domain: taxiak
*/

/* ==========================================================================
   Colours & basics — brand colours are here
   ========================================================================== */
:root {
	--yellow: #FDDA01;   /* logo yellow */
	--blue: #053E96;     /* "Ak" blue */
	--blue-dark: #042F73;
	--navy: #0E1A2B;     /* "Taxi" dark */
	--ink: #1D2430;
	--muted: #5F6876;
	--line: #D9DEE5;
	--bg-soft: #F4F5F7;
	--danger: #B42318;
	--success: #146C2E;
	--font: "Archivo", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
}

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

html { -webkit-text-size-adjust: 100%; }
html.dialog-open { overflow: hidden; }

body {
	margin: 0;
	overflow-x: clip;
	font-family: var(--font);
	font-size: 17px;
	line-height: 1.6;
	color: var(--ink);
	background: #fff;
}

img { max-width: 100%; height: auto; display: block; }
a { color: var(--blue); }
a:hover { color: var(--blue-dark); }

h1, h2, h3 { color: var(--navy); line-height: 1.15; margin: 0 0 .5em; }

.container {
	width: 100%;
	max-width: 1180px;
	margin: 0 auto;
	padding: 0 20px;
}

.skip-link {
	position: absolute;
	left: -9999px;
	top: 8px;
	z-index: 100;
	background: var(--navy);
	color: #fff;
	padding: 8px 14px;
}
.skip-link:focus { left: 8px; }

:focus-visible { outline: 3px solid var(--blue); outline-offset: 2px; }

/* ==========================================================================
   Buttons
   ========================================================================== */
.btn {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	font: inherit;
	font-weight: 700;
	line-height: 1.2;
	text-decoration: none;
	border: 0;
	border-radius: 3px;
	padding: 11px 20px;
	cursor: pointer;
}

.btn-primary { background: var(--blue); color: #fff; }
.btn-primary:hover { background: var(--blue-dark); color: #fff; }
.btn-primary:disabled { opacity: .7; cursor: wait; }

.btn-block { width: 100%; padding: 14px 20px; font-size: 1.05rem; }
.btn-large { padding: 15px 44px; font-size: 1.15rem; }

/* ==========================================================================
   Top bar (opening hours, phone, languages)
   ========================================================================== */
.topbar { background: var(--navy); color: #C9D1DC; font-size: 14px; }
.topbar-inner { display: flex; align-items: center; justify-content: space-between; gap: 16px; min-height: 40px; }
.topbar-info { margin: 0; display: flex; gap: 18px; }
.topbar-phone { color: #fff; font-weight: 600; text-decoration: none; }
.topbar-phone:hover { color: var(--yellow); }

.lang-switch { display: flex; align-items: center; gap: 10px; }
.lang-flag {
	display: block;
	padding: 3px 0;
	border-bottom: 2px solid transparent;
	opacity: .55;
	cursor: pointer;
	list-style: none;
}
.lang-flag::-webkit-details-marker { display: none; }
.lang-flag img { width: 27px; height: 18px; object-fit: cover; }
.lang-flag:hover, .lang-flag.is-current { opacity: 1; }
.lang-flag.is-current { border-bottom-color: var(--yellow); }

.lang-more { position: relative; }
.lang-more[open] .lang-flag { opacity: 1; }
.lang-more-panel {
	position: absolute;
	right: 0;
	top: calc(100% + 8px);
	z-index: 60;
	width: 220px;
	background: #fff;
	color: var(--ink);
	border: 1px solid var(--line);
	padding: 12px 14px;
	box-shadow: 0 6px 18px rgba(0, 0, 0, .12);
}
.lang-more-panel p { margin: 0; }

@media (max-width: 560px) {
	.topbar-hours { display: none; }
}

/* ==========================================================================
   Header — yellow, so the logo blends in
   ========================================================================== */
.site-header {
	background: var(--yellow);
	position: sticky;
	top: 0;
	z-index: 50;
	border-bottom: 1px solid rgba(14, 26, 43, .12);
}
.admin-bar .site-header { top: 32px; }
@media (max-width: 782px) { .admin-bar .site-header { top: 46px; } }
@media (max-width: 600px) { .admin-bar .site-header { top: 0; } }

.header-inner {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 16px;
	padding-top: 10px;
	padding-bottom: 10px;
}

.site-logo img { height: clamp(58px, 9vw, 92px); width: auto; }

.btn-now { background: var(--navy); color: #fff; font-size: 1.05rem; padding: 14px 24px; white-space: nowrap; }
.btn-now:hover { background: var(--blue); color: #fff; }
.label-short { display: none; }

@media (max-width: 480px) {
	.site-logo img { height: 52px; }
	.label-long { display: none; }
	.label-short { display: inline; }
	.btn-now { padding: 12px 16px; font-size: 1rem; }
}

/* ==========================================================================
   Messages after sending
   ========================================================================== */
.notice { padding: 14px 0; font-weight: 600; }
.notice-success { background: #E7F4EA; color: var(--success); }
.notice-error { background: #FBEAE8; color: var(--danger); }

/* ==========================================================================
   Pages edited with the block editor (Home, About us, …)
   ========================================================================== */
.content-wrap { padding-top: 44px; padding-bottom: 80px; }

.page-title { font-size: clamp(1.9rem, 4vw, 2.6rem); font-weight: 800; }

.entry-content > * { margin-top: 0; margin-bottom: 1.1em; }
.entry-content > :last-child { margin-bottom: 0; }
.entry-content > h1 { font-size: clamp(1.9rem, 4vw, 2.6rem); font-weight: 800; margin-bottom: .6em; }
.entry-content > h2 { font-size: clamp(1.4rem, 3vw, 1.9rem); font-weight: 800; margin-top: 1.6em; }
.entry-content > h3 { font-size: 1.25rem; font-weight: 700; margin-top: 1.4em; }

.is-style-lead { font-size: 1.15rem; color: var(--muted); max-width: 640px; }

.alignwide { max-width: 1180px; margin-left: auto; margin-right: auto; }
.alignfull { width: 100vw; max-width: 100vw; margin-left: calc(50% - 50vw); margin-right: calc(50% - 50vw); }

.wp-block-button__link { border-radius: 3px; font-weight: 700; padding: 11px 22px; }
.wp-block-button:not(.is-style-outline) .wp-block-button__link:not(.has-background) { background-color: var(--blue); }
.wp-block-button:not(.is-style-outline) .wp-block-button__link:not(.has-text-color) { color: #fff; }
.wp-block-button:not(.is-style-outline) .wp-block-button__link:not(.has-background):hover { background-color: var(--blue-dark); }

/* ==========================================================================
   Destination cards (WordPress Query Loop on the Home page)
   Card: photo with label, title, info lines with icons, price + Book
   ========================================================================== */
.taxiak-destinations { margin-top: 8px; margin-bottom: 40px; }
.taxiak-destinations .wp-block-post-template { list-style: none; margin: 0; padding: 0; gap: 28px; }
.taxiak-destinations .wp-block-post-template > li,
.taxiak-destinations .wp-block-post { margin: 0; display: flex; }
@media (min-width: 601px) and (max-width: 960px) {
	.taxiak-destinations .wp-block-post-template.is-layout-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 22px; }
}
@media (max-width: 600px) {
	.taxiak-destinations .wp-block-post-template.is-layout-grid { grid-template-columns: 1fr; gap: 22px; }
}

.trip-card {
	position: relative;
	display: flex;
	flex-direction: column;
	width: 100%;
	background: #fff;
	border: 1px solid var(--line);
	border-radius: 12px;
	overflow: hidden;
	transition: box-shadow .15s, border-color .15s;
}
.trip-card:hover { border-color: #C3CAD4; box-shadow: 0 4px 14px rgba(14, 26, 43, .08); }
.trip-card > *, .trip-card-media > *, .trip-card-body > * { margin: 0 !important; }
/* Classic themes wrap group contents in an extra div; let the card layout see through it. */
.trip-card .wp-block-group__inner-container { display: contents; }

/* Photo + label on top of it */
.trip-card-media { position: relative; }
.trip-card .wp-block-post-featured-image { width: 100%; margin: 0 !important; background: var(--bg-soft); }
.trip-card .wp-block-post-featured-image img { width: 100%; height: 100%; aspect-ratio: 4 / 3; object-fit: cover; }
.trip-card-label {
	margin: 0 !important;
	position: absolute;
	left: 12px;
	top: 12px;
	z-index: 2;
	background: var(--yellow);
	color: var(--navy);
	font-size: .85rem;
	font-weight: 700;
	line-height: 1.2;
	padding: 6px 12px;
	border-radius: 999px;
}
.trip-card-label:empty { display: none; }

/* Text part */
.trip-card-body { display: flex; flex-direction: column; flex: 1; padding: 14px 16px 16px; }
.trip-card .wp-block-post-title { font-size: 1.2rem; font-weight: 800; line-height: 1.25; margin: 0 0 10px !important; }
.trip-card .wp-block-post-title a { color: var(--blue); text-decoration: none; }

.trip-info { position: relative; padding-left: 28px; color: var(--ink); font-size: .95rem; line-height: 1.35; margin: 0 0 6px !important; }
.trip-info:empty { display: none; }
.trip-info::before {
	content: "";
	position: absolute;
	left: 0;
	top: 0;
	width: 19px;
	height: 19px;
	background: var(--blue);
	-webkit-mask: var(--icon) center / contain no-repeat;
	mask: var(--icon) center / contain no-repeat;
}
.trip-info-area { --icon: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M12 21s-7-6.2-7-11.5A7 7 0 0 1 19 9.5C19 14.8 12 21 12 21z'/%3E%3Ccircle cx='12' cy='9.5' r='2.5'/%3E%3C/svg%3E"); }
.trip-info-pickup { --icon: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M5 16V11l2-5h10l2 5v5'/%3E%3Cpath d='M3 16h18v3H3z'/%3E%3Ccircle cx='7.5' cy='13.5' r='.5'/%3E%3Ccircle cx='16.5' cy='13.5' r='.5'/%3E%3Cpath d='M5 11h14'/%3E%3C/svg%3E"); }
.trip-info-distance { --icon: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Ccircle cx='6' cy='19' r='2'/%3E%3Ccircle cx='18' cy='5' r='2'/%3E%3Cpath d='M8 19h8.5a3.5 3.5 0 0 0 0-7h-9a3.5 3.5 0 0 1 0-7H16'/%3E%3C/svg%3E"); }
.trip-info-time { --icon: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Ccircle cx='12' cy='12' r='9'/%3E%3Cpath d='M12 7v5l3 2'/%3E%3C/svg%3E"); }

.trip-price-old { margin-top: 10px !important; color: var(--danger); font-size: .9rem; font-weight: 600; }
.trip-price-old:empty { display: none; }

.trip-card-foot { margin-top: auto !important; padding-top: 12px; gap: 12px; align-items: flex-end; }
.trip-price { margin: 0 !important; line-height: 1.1; color: var(--ink); white-space: nowrap; flex: 1 1 auto; min-width: 0; }
.trip-price strong { font-size: 1.6rem; font-weight: 800; color: var(--navy); }
.trip-price-from, .trip-price-unit { font-size: .95rem; color: var(--muted); }

.trip-card .wp-block-read-more {
	position: relative;
	z-index: 2;
	flex-shrink: 0;
	background: var(--yellow);
	color: var(--navy);
	font-weight: 700;
	line-height: 1.2;
	text-decoration: none;
	border-radius: 6px;
	padding: 10px 20px;
}
.trip-card .wp-block-read-more:hover { background: var(--navy); color: #fff; }

/* Whole card is clickable on the website (not inside the editor) */
body:not(.editor-styles-wrapper) .trip-card .wp-block-post-title a::after {
	content: "";
	position: absolute;
	inset: 0;
	z-index: 1;
}

/* ==========================================================================
   Trip page: title, photo, text, Book
   ========================================================================== */
.trip { max-width: 1000px; padding-top: 28px; padding-bottom: 80px; }

.back-link { display: inline-block; font-size: .95rem; color: var(--muted); text-decoration: none; margin-bottom: 14px; }
.back-link:hover { color: var(--blue); }

.trip-title { font-size: clamp(2rem, 5vw, 3rem); font-weight: 800; margin: 0 0 18px; }

.trip-media { margin: 0 0 32px; aspect-ratio: 2 / 1; background: var(--bg-soft); overflow: hidden; }
.trip-media img { width: 100%; height: 100%; object-fit: cover; }

.trip-body { display: grid; grid-template-columns: minmax(0, 1fr) 320px; gap: 48px; align-items: start; }

.trip-text .entry-content { font-size: 1.1rem; line-height: 1.7; }
.trip-meta { color: var(--muted); font-size: .95rem; margin: 18px 0 0; }

.trip-book { text-align: right; }
.trip-prices { width: 100%; border-collapse: collapse; margin: 0 0 4px; }
.trip-prices th { text-align: left; font-weight: 500; color: var(--muted); padding: 6px 12px 6px 0; white-space: nowrap; }
.trip-prices td { text-align: right; font-weight: 800; color: var(--navy); font-size: 1.25rem; padding: 4px 0; white-space: nowrap; }
.trip-prices tr + tr { border-top: 1px solid var(--line); }
.trip-price-note { margin: 0 0 14px; font-size: .85rem; color: var(--muted); text-align: right; }
.trip-book .trip-price { margin: 0 0 12px; }
.trip-book .trip-price strong { font-size: 1.5rem; color: var(--navy); }
.trip-book .trip-price span { color: var(--muted); }
.trip-book .btn { width: 100%; margin-top: 14px; }

@media (max-width: 760px) {
	.trip-body { grid-template-columns: 1fr; gap: 0; }
	.trip-media { aspect-ratio: 3 / 2; margin-bottom: 22px; }

	/* Book bar fixed to the bottom of the screen on phones */
	.single-destination { padding-bottom: 84px; }
	.trip-book {
		position: fixed;
		left: 0;
		right: 0;
		bottom: 0;
		z-index: 40;
		display: flex;
		align-items: center;
		justify-content: space-between;
		gap: 16px;
		padding: 12px 20px calc(12px + env(safe-area-inset-bottom));
		background: #fff;
		border-top: 1px solid var(--line);
		text-align: left;
	}
	.trip-book .trip-price { margin: 0; line-height: 1.2; }
	.trip-book .trip-price strong { font-size: 1.25rem; display: block; }
	.trip-book .trip-price span { font-size: .85rem; }
	.trip-book .btn { width: auto; margin-top: 0; padding: 13px 26px; flex-shrink: 0; }
	.trip-prices { width: auto; margin: 0; }
	.trip-prices th, .trip-prices td { padding: 1px 0; font-size: .8rem; }
	.trip-prices td { font-size: 1rem; padding-left: 12px; }
	.trip-prices tr + tr { border-top: 0; }
	.trip-price-note { display: none; }
}

/* ==========================================================================
   Popups (Book a Taxi Now + trip booking)
   ========================================================================== */
.taxiak-dialog {
	width: min(540px, calc(100% - 24px));
	max-height: calc(100dvh - 24px);
	border: 0;
	border-radius: 4px;
	padding: 0;
	box-shadow: 0 20px 60px rgba(0, 0, 0, .35);
	overflow: auto;
}
.taxiak-dialog::backdrop { background: rgba(14, 26, 43, .6); }

.dialog-head {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 12px;
	background: var(--yellow);
	padding: 14px 20px;
}
.dialog-head h2 { margin: 0; font-size: 1.35rem; font-weight: 800; }
.dialog-close {
	width: 38px; height: 38px;
	border: 0;
	background: transparent;
	font-size: 1.8rem;
	line-height: 1;
	cursor: pointer;
	color: var(--navy);
}
.dialog-close:hover { background: rgba(14, 26, 43, .1); }

.dialog-body { padding: 20px; }
.dialog-alt { text-align: center; margin: 12px 0 0; color: var(--muted); font-size: .93rem; }
.dialog-alt a { font-weight: 700; }
.dialog-price { display: flex; justify-content: space-between; margin: 4px 0 14px; color: var(--muted); }
.dialog-price strong { color: var(--navy); }

.form-error { background: #FBEAE8; color: var(--danger); font-weight: 600; padding: 10px 12px; margin: 0 0 16px; }

@media (max-width: 600px) {
	.taxiak-dialog { width: 100%; max-width: 100%; max-height: 100dvh; height: 100dvh; margin: 0; border-radius: 0; }
}

/* Popup shown after a booking is sent */
.done-dialog { width: min(420px, calc(100% - 32px)); height: fit-content !important; text-align: center; }
.done-dialog .dialog-body { padding: 28px 24px 24px; }
.done-dialog h2 { font-size: 1.2rem; font-weight: 700; line-height: 1.4; margin: 0 0 20px; }
.done-check { width: 56px; height: 56px; margin: 0 auto 14px; border-radius: 50%; background: #E7F4EA; color: var(--success); font-size: 30px; font-weight: 800; line-height: 56px; }
@media (max-width: 600px) { .done-dialog { height: fit-content !important; max-height: calc(100dvh - 32px); margin: auto; border-radius: 6px; } }

/* ==========================================================================
   Form fields
   ========================================================================== */
.field { margin-bottom: 14px; }
.field-row { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
@media (max-width: 420px) { .field-row { grid-template-columns: 1fr; gap: 0; } }

.field label { display: block; font-weight: 600; font-size: .9rem; margin-bottom: 4px; color: var(--navy); }
.optional { font-weight: 400; color: var(--muted); }
.req { color: var(--danger); font-weight: 700; }
.field input.is-auto { background: #ECEEF2; color: var(--muted); border-color: #D5DAE1; cursor: default; pointer-events: none; }

.field input,
.field select,
.field textarea {
	width: 100%;
	font: inherit;
	font-size: 16px; /* stops iPhone zooming in */
	color: var(--ink);
	background: #fff;
	border: 1px solid #BFC7D2;
	border-radius: 3px;
	padding: 10px 12px;
	min-height: 44px;
}
.field textarea { resize: vertical; }
.field input:focus,
.field select:focus,
.field textarea:focus { border-color: var(--blue); outline: 2px solid rgba(5, 62, 150, .2); outline-offset: 0; }

.btn-gps {
	width: 100%;
	gap: 8px;
	background: var(--bg-soft);
	color: var(--blue);
	border: 1px solid #BFC7D2;
	margin-bottom: 8px;
	font-weight: 600;
}
.btn-gps:hover { background: #E9EDF3; }
.has-gps .btn-gps { background: #E7F4EA; color: var(--success); border-color: #A9D5B5; }

.gps-status { font-size: .85rem; color: var(--muted); margin: 0 0 8px; }
.gps-status:empty { display: none; }
.has-error .gps-status { color: var(--danger); font-weight: 600; }
.has-error input[data-location-input] { border-color: var(--danger); }

.hp { position: absolute; left: -9999px; width: 1px; height: 1px; overflow: hidden; }

/* ==========================================================================
   Footer
   ========================================================================== */
.site-footer { background: var(--navy); color: #AEB7C4; font-size: .95rem; padding-top: 40px; }
.footer-inner { display: flex; flex-wrap: wrap; gap: 32px 72px; }
.footer-col p { margin: 0 0 6px; }
.footer-brand { font-size: 1.5rem; font-weight: 800; color: #fff; }
.footer-brand span { color: var(--yellow); }
.footer-company { margin-top: 10px !important; font-size: .88rem; }
.footer-title { color: #fff; font-weight: 700; }
.footer-menu { list-style: none; margin: 0; padding: 0; }
.footer-menu li { margin-bottom: 6px; }
.site-footer a { color: #fff; text-decoration: none; }
.site-footer a:hover { color: var(--yellow); }
.footer-bottom { border-top: 1px solid rgba(255, 255, 255, .1); margin-top: 32px; padding-top: 16px; padding-bottom: 20px; font-size: .85rem; }
.footer-bottom p { margin: 0; }

/* ==========================================================================
   WhatsApp button — in the header, right of "Book a Taxi Now"
   (only shown when a number is set in Customize)
   ========================================================================== */
.header-actions { display: flex; align-items: center; gap: 10px; }
.btn-whatsapp {
	gap: 8px;
	background: #25D366;
	color: #fff;
	font-size: 1.05rem;
	padding: 12px 18px;
	white-space: nowrap;
}
.btn-whatsapp:hover { background: #1DA851; color: #fff; }
.btn-whatsapp img { width: 24px; height: 24px; }
@media (max-width: 480px) {
	.header-actions { gap: 8px; }
	.btn-whatsapp { padding: 10px 11px; }
}

/* ==========================================================================
   WooCommerce (cart / checkout) in TaxiAk colours
   ========================================================================== */
.woocommerce a.button.alt, .woocommerce button.button.alt, .woocommerce input.button.alt,
.woocommerce #place_order, .wc-block-components-checkout-place-order-button {
	background-color: var(--blue) !important;
	color: #fff !important;
	border-radius: 3px !important;
	font-weight: 700;
}
.woocommerce a.button.alt:hover, .woocommerce button.button.alt:hover, .woocommerce #place_order:hover,
.wc-block-components-checkout-place-order-button:hover { background-color: var(--blue-dark) !important; }
.woocommerce-checkout .content-wrap, .woocommerce-cart .content-wrap { max-width: 1100px; }

/* ==========================================================================
   "Get the app" button — header on computers, top bar on phones
   ========================================================================== */
.topbar-right { display: flex; align-items: center; gap: 16px; }
.btn-app { gap: 8px; white-space: nowrap; }
.app-in-header {
	background: transparent;
	color: var(--navy);
	border: 2px solid var(--navy);
	font-size: 1.05rem;
	padding: 10px 16px;
}
.app-in-header:hover { background: var(--navy); color: #fff; }
.btn-app.is-inactive { cursor: default; }
.app-in-header.is-inactive:hover { background: transparent; color: var(--navy); }
.app-in-topbar { display: none; padding: 4px 10px; font-size: .85rem; color: var(--navy); background: var(--yellow); border-radius: 3px; }
.app-in-topbar svg { width: 15px; height: 15px; }
@media (max-width: 860px) {
	.app-in-header { display: none; }
	.app-in-topbar { display: inline-flex; }
}
.app-label-short { display: none; }
.topbar-phone { white-space: nowrap; }
@media (max-width: 480px) {
	.topbar-right { gap: 12px; }
	.lang-switch { gap: 8px; }
	.app-in-topbar .app-label-long { display: none; }
	.app-in-topbar .app-label-short { display: inline; }
}

/* Small phones: keep the price row inside the card */
.taxiak-destinations .wp-block-post-template > li, .taxiak-destinations .wp-block-post { min-width: 0; }
@media (max-width: 400px) {
	.trip-price strong { font-size: 1.35rem; }
	.trip-price-from, .trip-price-unit { font-size: .85rem; }
	.trip-card .wp-block-read-more { padding: 9px 14px; }
	.trip-card-body { padding: 12px 14px 14px; }
}
