/*
 * Oriel Online — Adventurer's Journal (main theme)
 * A printed travel journal and community noticeboard: oat paper, forest ink,
 * sage panels and a sunny watercolor town. Light and Dark appearances share
 * one composition; the logo and artwork are never recoloured.
 * Components come from ../../oriel-base/css/oriel-base.css and oriel-controls.css.
 */
:root {
	--o-canvas: #f3efe3;
	--o-surface: #fffdf6;
	--o-surface-2: #ece6d6;
	--o-text: #25332c;
	--o-text-2: #5f695f;
	--o-heading: #263f36;
	--o-border: #beb49d;
	--o-input-border: #817c68;
	--o-input-bg: #fffdf6;
	--o-accent: #a48045;          /* brass: fine details */
	--o-accent-text: #87452f;
	--o-action: #263f36;          /* forest ink */
	--o-action-hover: #1b2f28;
	--o-on-action: #fffdf6;
	--o-outline: #87452f;
	--o-link: #87452f;            /* dark terracotta */
	--o-link-hover: #6b3423;
	--o-focus: #263f36;
	--o-icon: #5f8a52;
	--o-rule: #a9a08a;            /* card title rules */
	--o-nav-rule: #beb49d;
	--o-nav-active: #263f36;
	--o-sage: #e2ebdf;
	--o-sage-line: #b9c9b6;
	--o-terracotta: #b76e53;
	--o-tag-bg: #9e5538;
	--o-tag-fg: #fffdf6;
	--o-strip-bg: #263f36;
	--o-strip-ink: #f3efe3;
	--o-footer-art: .9;
	--o-info-bg: #e7eee5;
	--o-table-head: #ece6d6;
	--o-table-stripe: rgba(38, 63, 54, 0.03);
	--o-shadow: 0 1px 2px rgba(38, 51, 44, 0.05);
	--o-radius: 10px;
	--o-radius-sm: 8px;
	--o-font-body: "Oriel Sans", "Source Sans 3", "Source Sans Pro", system-ui, -apple-system, "Segoe UI", sans-serif;
	--o-font-display: "Oriel Journal Serif", "Lora", Georgia, "Times New Roman", serif;
	--o-wrap: 1460px;
	--o-gutter: 28px;
}
:root[data-mode="dark"] {
	--o-canvas: #151f1c;
	--o-surface: #1e2b25;
	--o-surface-2: #24342d;
	--o-text: #f2ecdd;
	--o-text-2: #bec7ba;
	--o-heading: #f2ecdd;
	--o-border: #445748;
	--o-input-border: #788b77;
	--o-input-bg: #18251f;
	--o-accent: #d1af72;
	--o-accent-text: #e6ae8d;
	--o-action: #b9d0aa;          /* sage */
	--o-action-hover: #cadcbd;
	--o-on-action: #172219;
	--o-outline: #e6ae8d;
	--o-link: #e6ae8d;
	--o-link-hover: #f3c8ae;
	--o-focus: #d1af72;
	--o-icon: #a9c79a;
	--o-rule: #a88b52;
	--o-nav-rule: #a88b52;
	--o-nav-active: #b9d0aa;
	--o-sage: #20302a;
	--o-sage-line: #4f6a56;
	--o-terracotta: #d1af72;
	--o-tag-bg: #9e5538;
	--o-tag-fg: #fffdf6;
	--o-strip-bg: #0f1815;
	--o-strip-ink: #f2ecdd;
	--o-footer-art: .75;
	--o-info-bg: #22342c;
	--o-table-head: #24342d;
	--o-table-stripe: rgba(242, 236, 221, 0.035);
	--o-shadow: 0 1px 2px rgba(0, 0, 0, 0.25);
	--o-error: #f2a593;
	--o-error-bg: #3b221c;
	--o-success: #a9d6a0;
	--o-success-bg: #1d3323;
	--o-warning: #e9c77f;
	--o-warning-bg: #372c17;
}

body.o-journal {
	background-color: var(--o-canvas);
	/* Extremely subtle paper grain; dense data sits on solid surfaces above it. */
	background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='160' height='160'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.9' numOctaves='2' stitchTiles='stitch'/%3E%3CfeColorMatrix values='0 0 0 0 .35 0 0 0 0 .3 0 0 0 0 .2 0 0 0 .05 0'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
	font-size: 17px;
}
.o-journal .o-content, .o-journal .o-card { font-size: 16px; }

/* ---------- Utility strip: status, account, theme and appearance ---------- */
.o-topstrip {
	position: relative; z-index: 50;
	background: var(--o-strip-bg); color: var(--o-strip-ink);
	--o-prefs-bg: transparent; --o-prefs-ink: var(--o-strip-ink); --o-prefs-line: color-mix(in srgb, var(--o-strip-ink) 55%, transparent);
	--o-prefs-on-bg: var(--o-strip-ink); --o-prefs-on-ink: #1f332b;
}
.o-topstrip :focus-visible { outline-color: var(--o-strip-ink); }
.o-topstrip__inner { display: flex; justify-content: space-between; align-items: center; gap: 8px 20px; min-height: 46px; }
.o-topstrip p { margin: 0; font-size: 15px; }
.o-topstrip__summary { font-family: var(--o-font-display); letter-spacing: .04em; }
.o-topstrip__tools { display: flex; flex-wrap: wrap; align-items: center; justify-content: flex-end; gap: 6px 0; margin-left: auto; }
.o-topstrip__tools > * { padding-inline: 16px; }
.o-topstrip__tools > * + * { border-left: 1px solid color-mix(in srgb, var(--o-strip-ink) 40%, transparent); }
.o-topstrip__tools > :last-child { padding-right: 0; }
.o-topstrip__status { font-family: var(--o-font-display); font-style: italic; }
.o-topstrip .o-nav__link { min-height: 36px; padding: 4px 4px; color: var(--o-strip-ink); font-size: 15px; font-weight: 600; }
.o-topstrip .o-nav__link:hover { color: var(--o-strip-ink); text-decoration: underline; }
.o-topstrip .o-btn__icon { width: 17px; height: 17px; }
.o-topstrip .o-theme-menu__button { min-height: 34px; padding: 4px 8px 4px 10px; border-color: transparent; font-size: 15px; }
.o-topstrip .o-theme-menu__button:hover { border-color: var(--o-prefs-line); }
.o-topstrip .o-prefs { gap: 8px 16px; }
.o-topstrip .o-mode__btn { min-height: 30px; padding: 3px 12px; font-size: 14px; }
.o-topstrip .o-submenu, .o-topstrip .o-theme-menu__panel { color: var(--o-text); }

/* ---------- Masthead ---------- */
.o-masthead { position: relative; z-index: 30; overflow: visible; }
.o-masthead__leaves { position: absolute; top: 8px; width: 220px; height: auto; pointer-events: none; mix-blend-mode: multiply; }
:root[data-mode="dark"] .o-masthead__leaves, :root[data-mode="dark"] .o-footer__leaves { mix-blend-mode: normal; opacity: .9; }
.o-masthead__leaves--left { left: 0; }
.o-masthead__leaves--right { right: 0; }
.o-masthead__inner { position: relative; display: flex; flex-direction: column; align-items: center; padding-top: 6px; }
.o-masthead__brand { display: flex; align-items: center; gap: 28px; }
.o-brand { display: inline-flex; border-radius: 8px; }
.o-brand img { display: block; width: 220px; }
.o-compass { display: inline-flex; align-items: center; gap: 6px; color: var(--o-terracotta); }
.o-compass::before, .o-compass::after { content: ""; width: 18px; height: 1.5px; background: currentColor; }
.o-compass__star { width: 34px; height: 34px; }

.o-nav { width: 100%; display: flex; justify-content: center; align-items: center; border-bottom: 1px solid var(--o-nav-rule); }
.o-nav__list { gap: clamp(4px, 2.6vw, 48px); }
.o-nav__link {
	position: relative; min-height: 54px; padding: 10px 18px;
	font-family: var(--o-font-display); font-size: 21px; font-weight: 600; color: var(--o-text);
}
.o-nav__link:hover { color: var(--o-heading); }
.o-nav__link::after { content: ""; position: absolute; left: 0; right: 0; bottom: -1px; height: 3px; background: var(--o-nav-active); transform: scaleX(0); transition: transform .15s ease; }
.o-nav__link.is-active, .o-nav__link[aria-current="page"] { color: var(--o-heading); }
.o-nav__link.is-active::after, .o-nav__link[aria-current="page"]::after { transform: scaleX(1); }
.o-nav__link:hover::after { transform: scaleX(.4); }
.o-nav__toggle .o-nav__chevron { width: 15px; height: 15px; }
.o-submenu { font-family: var(--o-font-body); }
.o-submenu__link { font-size: 16px; }

/* ---------- Panorama hero (fixed paper colours over the artwork) ---------- */
.o-panorama { position: relative; margin-top: 16px; height: clamp(300px, 26vw, 400px); overflow: hidden; }
.o-panorama__art, .o-panorama__art picture { position: absolute; inset: 0; }
.o-panorama__img { width: 100%; height: 100%; object-fit: cover; object-position: 50% 55%; }
.o-panorama__copy {
	position: absolute; left: 50%; top: 14%; transform: translateX(-50%);
	display: flex; flex-direction: column; align-items: center; gap: 22px;
	width: min(680px, 90%); padding: 18px 28px 22px;
	text-align: center;
	background: radial-gradient(closest-side, rgba(255, 253, 246, .82), rgba(255, 253, 246, .55) 70%, rgba(255, 253, 246, 0));
}
.o-panorama__title { margin: 0; font-family: var(--o-font-display); font-weight: 700; font-size: clamp(40px, 4.2vw, 60px); line-height: 1.06; color: #263f36; text-wrap: balance; }
.o-btn--paper {
	min-height: 48px; padding: 8px 34px;
	border: 1.5px solid #87452f; border-radius: 8px;
	background: #fbf2e4; color: #87452f;
	font-family: var(--o-font-display); font-size: 21px; font-weight: 600;
	box-shadow: 0 2px 0 rgba(135, 69, 47, .15);
}
.o-btn--paper:hover { background: #fff8ec; color: #6b3423; }
.o-panorama .o-btn--paper:focus-visible { outline-color: #263f36; }

/* ---------- Home portal ---------- */
.o-home { display: grid; grid-template-columns: minmax(300px, 380px) minmax(0, 1fr) minmax(280px, 400px); gap: 20px; align-items: start; padding-block: 22px 40px; }
.o-card { padding: 24px; border-radius: var(--o-radius); box-shadow: var(--o-shadow); }
.o-card__title {
	gap: 12px; margin-bottom: 18px; padding-bottom: 12px;
	border-bottom: 1px solid var(--o-rule);
	font-size: 27px; font-weight: 700; color: var(--o-heading);
}
.o-card__icon { color: var(--o-icon); width: 28px; height: 28px; }
.o-home__account .oriel-form .submit-button { font-family: var(--o-font-display); font-size: 21px; }
.o-home__account .oriel-form .form-links { justify-content: center; gap: 10px 0; }
.o-home__account .oriel-form .form-links > a + a { padding-left: 14px; margin-left: 14px; border-left: 1px solid var(--o-rule); }
.o-home__news .o-news-list > li + li { border-top: 1px solid var(--o-border); }
.o-news-item__inner { padding: 14px 0; gap: 22px; }
.o-home__news .o-news-list > li:first-child .o-news-item__inner { padding-top: 0; }
.o-news-item__img { width: 176px; height: 116px; border-radius: 6px; }
.o-news-item__title { font-size: 26px; font-weight: 700; margin-bottom: 6px; }
.o-news-item__text { margin-bottom: 8px; }
.o-news-item__link { font-size: 15px; }
.o-home__more { margin: 8px 0 0; }
.o-home__side { display: grid; gap: 20px; }
.o-glance__list { margin: 0; }
.o-glance__list div { display: grid; grid-template-columns: minmax(110px, 1fr) 1.2fr; gap: 12px; padding: 8px 12px; border-bottom: 1px solid var(--o-border); }
.o-glance__list div:last-child { border-bottom: 0; }
.o-glance__list dt, .o-glance__list dd { margin: 0; color: var(--o-text); }
.o-card--sage { background: var(--o-sage); border-color: var(--o-sage-line); }
.o-card--sage .o-card__title { border-bottom-color: var(--o-sage-line); }
.o-quick .o-quick-link { justify-content: center; background: var(--o-surface); border-color: var(--o-text); font-size: 17px; }
.o-quick .o-quick-link__label { flex: none; }
.o-quick .o-quick-link__icon { color: var(--o-text); }

/* ---------- Inner pages ---------- */
.o-page { padding-block: 28px 40px; }
.o-page__panel { padding: clamp(22px, 3vw, 40px); }
.o-content h2 { font-weight: 700; color: var(--o-heading); }
.o-content .generic-form, .o-content .generic-form-div, .o-content .o-auth-form { background: var(--o-canvas); box-shadow: none; }

/* ---------- Footer ---------- */
.o-footer.oriel-footer { position: relative; margin-top: 0; padding: 4px 0 34px; overflow: hidden; border-top: 0; }
.o-footer__inner { position: relative; z-index: 1; padding-top: 18px; border-top: 1px solid var(--o-nav-rule); }
.o-footer__leaves { position: absolute; left: 0; bottom: -18px; width: 150px; height: auto; transform: scaleY(-1) rotate(8deg); opacity: var(--o-footer-art); mix-blend-mode: multiply; pointer-events: none; }
.o-footer__compass { position: absolute; right: 28px; bottom: 10px; width: 60px; height: 60px; color: var(--o-accent); opacity: var(--o-footer-art); pointer-events: none; }

/* ---------- Responsive ---------- */
@media (max-width: 1180px) {
	.o-masthead__leaves { width: 160px; }
	.o-home { grid-template-columns: minmax(300px, 360px) minmax(0, 1fr); }
	.o-home__side { grid-column: 1 / -1; grid-template-columns: 1fr 1fr; }
	.o-nav .o-nav__link { font-size: 19px; padding-inline: 10px; }
	.o-topstrip__summary { display: none; }
}

@media (max-width: 900px) {
	.o-masthead__leaves { display: none; }
	.o-masthead__inner { flex-direction: row; flex-wrap: wrap; justify-content: space-between; padding-block: 10px; border-bottom: 1px solid var(--o-nav-rule); }
	.o-masthead__brand { gap: 0; }
	.o-compass { display: none; }
	.o-brand img { width: 130px; }
	.o-menu-toggle { display: inline-flex; border-color: var(--o-border); background: var(--o-surface); }
	.js .o-nav { display: none; }
	.o-nav { flex: 1 0 100%; flex-direction: column; align-items: stretch; gap: 0; border-bottom: 0; padding: 8px 0; }
	.js .o-nav.is-open { display: flex; }
	.o-nav__list { flex-direction: column; align-items: stretch; gap: 0; }
	.o-nav .o-nav__link { width: 100%; justify-content: space-between; min-height: 48px; font-size: 19px; border-bottom: 1px solid color-mix(in srgb, var(--o-border) 60%, transparent); }
	.o-nav .o-nav__link::after { display: none; }
	.o-nav .o-nav__link.is-active, .o-nav .o-nav__link[aria-current="page"] { color: var(--o-accent-text); }
	.o-nav .o-submenu { position: static; box-shadow: none; border: 0; padding: 4px 0 8px 16px; background: transparent; }
	.no-js .o-nav .o-submenu { display: block; }

	.o-topstrip__inner { padding-block: 6px; }
	.o-topstrip__tools { width: 100%; justify-content: space-between; margin-left: 0; }
	.o-topstrip__tools > * { padding-inline: 0; }
	.o-topstrip__tools > * + * { border-left: 0; }
	.o-topstrip .o-prefs { flex: 1 0 100%; justify-content: space-between; }

	/* Headline moves onto a solid paper surface above the panorama. */
	.o-panorama { height: auto; margin-top: 0; display: flex; flex-direction: column; overflow: visible; }
	.o-panorama__copy { position: static; transform: none; order: 1; width: 100%; padding: 26px var(--o-gutter) 24px; background: var(--o-surface); border-bottom: 1px solid var(--o-border); }
	.o-panorama__title { color: var(--o-heading); }
	.o-panorama__art { position: relative; order: 2; height: 220px; }
	.o-panorama__img { object-position: 22% 60%; }
	.o-home { grid-template-columns: minmax(0, 1fr); }
	.o-home__side { grid-template-columns: minmax(0, 1fr); }
	.o-footer__leaves, .o-footer__compass { display: none; }
}

@media (max-width: 560px) {
	:root { --o-gutter: 16px; }
	.o-panorama__title { font-size: clamp(34px, 10vw, 44px); }
	.o-btn--paper { width: 100%; }
	.o-panorama__art { height: 180px; }
	.o-card { padding: 20px 16px; }
	.o-news-item__inner { flex-direction: column; gap: 12px; }
	.o-news-item__img { width: 100%; height: auto; aspect-ratio: 16 / 9; }
	.o-page { padding-block: 16px 28px; }
	.o-topstrip__status { font-size: 14px; }
	.o-topstrip .o-theme-menu__button { padding-inline: 6px; }
	.o-topstrip .o-prefs__field--theme .o-prefs__label { display: none; }
}
