/*
Theme Name: The Hampton Court Companion
Theme URI: https://hamptoncourt.com/
Description: Magazine theme for hamptoncourt.com: stories, the six wives, visitor guides, partner bookings and tour sign-ups.
Version: 1.0.3
Requires at least: 6.4
Requires PHP: 8.0
Text Domain: hc-companion
License: GNU General Public License v2 or later
*/

@font-face { font-family: "Archivo"; src: url(assets/fonts/archivo-wdth.woff2) format("woff2"); font-weight: 100 900; font-stretch: 62% 125%; font-style: normal; font-display: swap; }
@font-face { font-family: "Newsreader"; src: url(assets/fonts/newsreader.woff2) format("woff2"); font-weight: 200 800; font-style: normal; font-display: swap; }
@font-face { font-family: "Newsreader"; src: url(assets/fonts/newsreader-italic.woff2) format("woff2"); font-weight: 200 800; font-style: italic; font-display: swap; }

:root {
  --ink: #000000;
  --paper: #FFFFFF;
  --crimson: #A3162F;
  --crimson-light: #FF8A9C;
  --grey: #444444;
  --rule: #CCCCCC;
  --wash: #F2F2F2;
  --sans: "Archivo", "Arial Narrow", Arial, sans-serif;
  --serif: "Newsreader", Georgia, serif;
  --wide: 1320px;
  --read: 720px;
  --gutter: clamp(16px, 3vw, 32px);
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--paper); color: var(--ink); font: 400 19px/1.55 var(--serif); }
img { max-width: 100%; height: auto; display: block; }
a { color: var(--ink); text-underline-offset: .15em; }
a:hover { color: var(--crimson); }
:focus-visible { outline: 3px solid var(--crimson); outline-offset: 2px; }
.screen-reader-text { position: absolute !important; width: 1px; height: 1px; overflow: hidden; clip: rect(1px,1px,1px,1px); white-space: nowrap; }
.skip-link:focus { position: fixed; left: 8px; top: 8px; z-index: 100; width: auto; height: auto; clip: auto; background: var(--ink); color: var(--paper); padding: 10px 16px; }

.wrap { max-width: var(--wide); margin: 0 auto; padding-left: var(--gutter); padding-right: var(--gutter); }
.read { max-width: calc(var(--read) + 2 * var(--gutter)); margin: 0 auto; padding-left: var(--gutter); padding-right: var(--gutter); }

/* Type helpers */
.display { font-family: var(--sans); font-weight: 800; font-stretch: 72%; letter-spacing: -0.02em; line-height: .92; margin: 0; }
.h-section { font-family: var(--sans); font-weight: 800; font-stretch: 75%; font-size: clamp(40px, 5vw, 64px); line-height: 1; letter-spacing: -0.01em; margin: 0; }
.h-card { font-family: var(--sans); font-weight: 800; font-stretch: 80%; line-height: 1.02; }
.kicker { font-family: var(--sans); font-weight: 700; font-size: 15px; color: var(--crimson); }
.meta { font-family: var(--sans); font-size: 15px; color: var(--grey); }
.lede { font-size: clamp(20px, 2vw, 26px); line-height: 1.4; }
.section { padding-top: clamp(56px, 7vw, 96px); }
.rule-top { border-top: 3px solid var(--ink); padding-top: 18px; }
.row-head { display: flex; flex-wrap: wrap; align-items: baseline; justify-content: space-between; gap: 12px; }
.more-link { font-family: var(--sans); font-weight: 700; font-size: 17px; color: var(--crimson); }

/* Buttons and forms */
.btn { display: inline-flex; align-items: center; justify-content: center; min-height: 48px; padding: 0 22px; font-family: var(--sans); font-weight: 700; font-size: 17px; text-decoration: none; border: 0; cursor: pointer; background: var(--crimson); color: var(--paper); }
.btn:hover { color: var(--paper); background: var(--crimson-dark, #84101F); }
.btn--outline { background: transparent; color: var(--ink); border: 2px solid var(--ink); }
.btn--outline:hover { background: var(--ink); color: var(--paper); }
.btn--dark { background: var(--ink); }
label { font-family: var(--sans); font-weight: 600; font-size: 15px; }
input[type=text], input[type=email], input[type=search], select, textarea { font: inherit; font-size: 18px; padding: 10px 14px; min-height: 48px; border: 2px solid var(--ink); border-radius: 0; background: var(--paper); color: var(--ink); width: 100%; }
.field { display: flex; flex-direction: column; gap: 6px; }
.check { display: flex; gap: 10px; align-items: flex-start; font-family: var(--sans); font-size: 16px; font-weight: 400; }
.check input { width: 22px; height: 22px; flex-shrink: 0; accent-color: var(--crimson); margin: 0; }
.hp { position: absolute; left: -9999px; }

/* Header */
.site-header { border-bottom: 3px solid var(--ink); background: var(--paper); }
.site-header .wrap { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 12px 28px; padding-top: 14px; padding-bottom: 14px; }
.brand { text-decoration: none; display: inline-flex; align-items: baseline; gap: 8px; line-height: 1; color: var(--ink); }
.brand__small { font-family: var(--serif); font-style: italic; font-size: 20px; }
.brand__name { font-family: var(--sans); font-weight: 800; font-stretch: 72%; font-size: 38px; letter-spacing: -0.01em; }
.brand img { max-height: 56px; width: auto; }
.brand__sub { display: none; }
@media (max-width: 600px) {
  .site-header .brand { flex-direction: column; align-items: flex-start; gap: 2px; }
  .site-header .brand__the, .site-header .brand__companion { display: none; }
  .site-header .brand__sub { display: block; }
}
.nav { display: flex; align-items: center; gap: 8px 22px; font-family: var(--sans); font-weight: 600; font-size: 16px; }
.nav ul { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: 8px 22px; }
.nav a { text-decoration: none; }
.nav .current-menu-item > a, .nav .current-menu-parent > a, .nav .current_page_item > a, .nav a[aria-current] { color: var(--crimson); text-decoration: underline; text-decoration-thickness: 3px; text-underline-offset: 8px; }
.icon-btn { width: 44px; height: 44px; display: inline-flex; align-items: center; justify-content: center; background: transparent; border: 0; padding: 0; cursor: pointer; color: var(--ink); }
.menu-toggle { display: none; border: 2px solid var(--ink); }
.header-actions { display: none; align-items: center; gap: 8px; }
.btn--small { min-height: 44px; padding: 0 14px; font-size: 15px; }
.search-panel { border-top: 1px solid var(--rule); padding: 16px 0; }
.search-panel[hidden] { display: none; }
.search-form { display: flex; gap: 10px; max-width: 640px; }
.search-form input { flex: 1; }

@media (max-width: 980px) {
  .brand__small { font-size: 15px; }
  .brand__name { font-size: min(28px, 6.2vw); white-space: nowrap; }
  .header-actions { display: flex; }
  .menu-toggle { display: inline-flex; }
  .nav { display: none; width: 100%; }
  .nav.is-open { display: flex; flex-direction: column; align-items: stretch; background: var(--ink); color: var(--paper); width: calc(100% + 2 * var(--gutter)); margin: 0 calc(-1 * var(--gutter)) -14px; padding: 8px var(--gutter) 20px; }
  .nav.is-open ul { flex-direction: column; gap: 0; }
  .nav.is-open a { color: var(--paper); display: block; padding: 12px 0; border-bottom: 1px solid #444; font-weight: 800; font-stretch: 78%; font-size: 32px; line-height: 1.05; }
  .nav.is-open .btn { margin-top: 16px; font-size: 18px; border-bottom: 0; }
  .nav .nav-search { display: none; }
}

/* Hero (home) */
.hero__figure { position: relative; margin: 0; }
.hero__img { display: block; width: 100%; height: clamp(280px, 45vw, 640px); object-fit: cover; object-position: 50% 60%; }
.hero__credit { position: absolute; right: 0; bottom: 0; padding: 4px 10px; background: rgba(0,0,0,.55); color: #fff; font-family: var(--sans); font-size: 12px; line-height: 1.4; }
.hero__credit a { color: #fff; text-decoration: none; }
.hero__credit a:hover { text-decoration: underline; }
.hero__text { display: flex; flex-wrap: wrap; gap: 24px 56px; align-items: flex-start; padding-top: 40px; }
.hero__title { flex: 2 1 520px; font-size: clamp(56px, 8vw, 112px); }
.hero__aside { flex: 1 1 300px; padding-top: 10px; }

/* Facts strip */
.facts { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); border-top: 3px solid var(--ink); border-bottom: 1px solid var(--ink); }
.facts > div { padding: 18px 24px 18px 0; }
.facts p { margin: 0; }
.facts .kicker { margin-bottom: 4px; }

/* Cards */
.card { text-decoration: none; display: flex; flex-direction: column; gap: 10px; color: var(--ink); min-width: 0; }
.card img, .card .ph { width: 100%; aspect-ratio: 3 / 2; object-fit: cover; }
.card .ph, .wife .ph { display: flex; align-items: center; justify-content: center; background: var(--crimson); }
.card .ph::after, .wife .ph::after { content: "C"; font-family: var(--serif); font-style: italic; font-size: 96px; line-height: 1; color: rgba(255,255,255,.9); }
.card__title { font-size: 30px; }
.card--lead .card__title { font-size: clamp(36px, 4vw, 52px); line-height: .98; }
.card--lead img { aspect-ratio: 16 / 9; }
.card__dek { font-size: 19px; color: #333; }
.grid-cards { display: grid; grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); gap: 48px 32px; }
.cover { display: grid; grid-template-columns: 2fr 1fr; gap: 40px; }
.cover__side { display: flex; flex-direction: column; gap: 36px; }
.cover__side .card__title { font-size: 28px; }
@media (max-width: 900px) { .cover { grid-template-columns: 1fr; } }

/* Numbered series */
.series { list-style: none; margin: 32px 0 0; padding: 0; display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 28px 20px; }
@media (max-width: 420px) { .series:not(.series--small) { grid-template-columns: 1fr 1fr; gap: 24px 14px; } .series:not(.series--small) .series__n { font-size: 52px; } .series:not(.series--small) a { font-size: 18px; } }
.series li { position: relative; display: flex; flex-direction: column; gap: 6px; }
.series a::after { content: ""; position: absolute; inset: 0; }
.series li:hover a, .series a:focus-visible { text-decoration: underline; }
.series li:hover .series__n { color: var(--ink); }
.series .is-current:hover .series__n { color: var(--crimson-light); }
.series__n { font-family: var(--sans); font-weight: 800; font-stretch: 70%; font-size: 72px; line-height: .9; color: var(--crimson); }
.series a { font-family: var(--sans); font-weight: 700; font-size: 22px; line-height: 1.15; text-decoration: none; }
.series__fate { font-size: 17px; color: #333; }
.series__img { display: block; width: 100%; aspect-ratio: 1 / 1; object-fit: cover; object-position: 50% 35%; margin-bottom: 10px; background: var(--wash); }
.series .ph { display: flex; align-items: center; justify-content: center; background: var(--crimson); }
.series .ph::after { content: "C"; font-family: var(--serif); font-style: italic; font-size: 64px; line-height: 1; color: rgba(255,255,255,.9); }
.series li:hover .series__img { opacity: .9; }
.series .is-current { background: var(--ink); color: var(--paper); padding: 0 10px 8px; }
.series .is-current .series__n { color: var(--crimson-light); }
.series .is-current a { color: var(--paper); }
.series--small { grid-template-columns: repeat(auto-fit, minmax(140px, 1fr)); gap: 16px; }
.series--small .series__n { font-size: 34px; }
.series--small a { font-size: 17px; }

/* Lists */
.list-links { list-style: none; margin: 16px 0 0; padding: 0; }
.list-links li { border-bottom: 1px solid var(--rule); }
.list-links a { text-decoration: none; display: flex; flex-wrap: wrap; align-items: baseline; gap: 6px 24px; padding: 18px 0; }
.list-links .kicker { flex: 0 0 180px; }
.list-links .h-card { flex: 1 1 360px; font-size: 28px; line-height: 1.1; }
.gyg-widget { margin: 16px 0 8px; min-height: 200px; }
.partner-list { list-style: none; margin: 12px 0 0; padding: 0; }
.partner-list li { border-top: 1px solid var(--ink); }
.partner-list li:last-child { border-bottom: 1px solid var(--ink); }
.partner-list a { text-decoration: none; display: flex; justify-content: space-between; gap: 16px; padding: 16px 0; }
.partner-list .h-card { font-size: 20px; font-weight: 700; font-stretch: 100%; line-height: 1.2; }

/* Dark band */
.band { background: var(--ink); color: var(--paper); margin-top: clamp(56px, 7vw, 96px); }
.band .wrap { padding-top: 72px; padding-bottom: 72px; }
.band a { color: var(--paper); }
.band .grid3 { display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); gap: 32px; margin-top: 36px; }
.band .grid3 a { text-decoration: none; display: flex; flex-direction: column; gap: 10px; border-top: 1px solid var(--paper); padding-top: 18px; }
.band .grid3 .h-card { font-size: 32px; }
.band .grid3 span.go { font-family: var(--sans); font-weight: 700; font-size: 16px; color: var(--crimson-light); }
.band small, .band .note { color: #BDBDBD; font-family: var(--sans); font-size: 15px; }
.split { display: flex; flex-wrap: wrap; gap: 48px; }
.split > * { flex: 1 1 420px; min-width: 0; }

/* Article */
.article-head { padding-top: 56px; }
.article-head .wrap { max-width: 1100px; }
.article-title { font-size: clamp(48px, 7vw, 96px); margin-top: 14px; }
.byline { display: flex; flex-wrap: wrap; gap: 8px 28px; margin-top: 28px; padding-top: 14px; border-top: 1px solid var(--ink); font-family: var(--sans); font-size: 15px; }
.crumbs { font-family: var(--sans); font-size: 15px; color: var(--grey); display: flex; flex-wrap: wrap; gap: 8px; }
.crumbs a { color: var(--grey); }
.lead-figure { margin: 40px 0 0; }
.lead-figure img { display: block; width: 100%; max-width: 1600px; margin: 0 auto; max-height: 640px; object-fit: cover; object-position: 50% 40%; }
.lead-figure figcaption, .wp-caption-text, figcaption { font-family: var(--sans); font-size: 14px; color: var(--grey); margin-top: 8px; }
.lead-figure figcaption { max-width: 1100px; margin: 10px auto 0; padding: 0 var(--gutter); }
.entry { font-size: 21px; line-height: 1.7; padding-top: 56px; }
.entry p { margin: 0 0 1.2em; }
.entry h2 { font-family: var(--sans); font-weight: 800; font-stretch: 80%; font-size: 40px; line-height: 1.02; margin: 1.8em 0 .5em; }
.entry h3 { font-family: var(--sans); font-weight: 800; font-stretch: 80%; font-size: 30px; line-height: 1.05; margin: 1.6em 0 .4em; }
.entry blockquote { margin: 1.6em 0; padding: 0; font-family: var(--sans); font-weight: 800; font-stretch: 78%; font-size: 40px; line-height: 1.04; color: var(--crimson); }
.entry blockquote p { margin: 0; }
.entry img.alignleft, .entry .alignleft { float: left; margin: .3em 1.4em 1em 0; max-width: 45%; }
.entry img.alignright, .entry .alignright { float: right; margin: .3em 0 1em 1.4em; max-width: 45%; }
.entry .aligncenter { margin-left: auto; margin-right: auto; }
.entry::after { content: ""; display: table; clear: both; }
.entry a { color: var(--crimson); }
@media (max-width: 600px) { .entry .alignleft, .entry .alignright, .entry img.alignleft, .entry img.alignright { float: none; max-width: 100%; margin: .5em 0 1em; } .entry { font-size: 19px; } }
.entry figure { margin: 1.8em 0; }
.entry figure img { display: block; width: 100%; height: auto; }
.entry figure.alignright { float: right; width: 42%; max-width: 42%; margin: .3em 0 1em 1.4em; }
.entry figcaption { font-family: var(--sans); font-size: 14px; line-height: 1.4; color: var(--grey); margin-top: 8px; }
.entry figcaption a { color: var(--grey); }
.entry h2[id], .entry h3[id] { scroll-margin-top: 90px; }
.entry .table-wrap { overflow-x: auto; margin: 1.2em 0 1.6em; }
.entry table { width: 100%; border-collapse: collapse; font-family: var(--sans); font-size: 17px; line-height: 1.4; }
.entry th, .entry td { text-align: left; padding: 10px 12px 10px 0; border-bottom: 1px solid var(--rule); vertical-align: top; }
.entry thead th { border-bottom: 3px solid var(--ink); font-weight: 800; }
.entry td:not(:first-child), .entry th:not(:first-child) { white-space: nowrap; }
.toc { margin: 0 0 2em; border-top: 3px solid var(--ink); border-bottom: 1px solid var(--ink); padding: 14px 0 10px; font-family: var(--sans); }
.toc__title { margin: 0 0 6px; font-weight: 800; font-stretch: 80%; font-size: 24px; line-height: 1.1; }
.toc ol { margin: 0; padding-left: 1.3em; font-size: 17px; line-height: 1.6; }
.toc a { color: var(--ink); }
.key-facts { margin: 1.4em 0 1.8em; padding: 18px 22px; background: var(--wash); font-family: var(--sans); font-size: 17px; line-height: 1.5; }
.key-facts p { margin: 0 0 .4em; }
.key-facts ul { margin: 0; padding-left: 1.2em; }
.glance { margin: 0 0 2em; border-top: 3px solid var(--ink); border-bottom: 1px solid var(--ink); padding: 14px 0 8px; font-family: var(--sans); }
.glance__title { margin: 0; font-weight: 800; font-stretch: 80%; font-size: 26px; line-height: 1.1; }
.glance dl { margin: 12px 0 0; display: grid; grid-template-columns: max-content 1fr; gap: 8px 24px; font-size: 17px; line-height: 1.4; }
.glance dt { font-weight: 700; color: var(--crimson); }
.glance dd { margin: 0; }
.visit-box { clear: both; margin: 2em 0; border: 3px solid var(--ink); padding: 28px; display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 20px; }
.visit-box .visit-box__title { margin: 0; font-family: var(--sans); font-weight: 800; font-stretch: 80%; font-size: 30px; line-height: 1.05; }
.visit-box p { margin: 6px 0 0; font-size: 18px; line-height: 1.45; }
.visit-box small { flex-basis: 100%; font-family: var(--sans); font-size: 13px; color: var(--grey); }
.pn { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 24px; margin-top: 32px; font-family: var(--sans); }
.pn a { text-decoration: none; border-top: 1px solid var(--ink); padding-top: 12px; }
.pn span { display: block; font-size: 14px; color: var(--grey); }
.pn strong { font-weight: 800; font-stretch: 80%; font-size: 26px; }
.pn .next { text-align: right; }

/* Hub (six wives) */
.wife { position: relative; border-top: 3px solid var(--ink); padding: 32px 0; display: flex; flex-wrap: wrap; gap: 24px 40px; align-items: flex-start; }
.wife:last-child { border-bottom: 3px solid var(--ink); }
.wife .h-card a::after { content: ""; position: absolute; inset: 0; }
.wife:hover .h-card a { text-decoration: underline !important; }
.wife:hover .wife__n { color: var(--ink); }
.wife__n { flex: 0 0 90px; font-family: var(--sans); font-weight: 800; font-stretch: 70%; font-size: 120px; line-height: .8; color: var(--crimson); }
.wife__img { flex: 0 0 280px; width: 280px; aspect-ratio: 4 / 3; object-fit: cover; background: var(--wash); }
.wife__body { flex: 1 1 360px; min-width: 0; }
.wife__body h2 { margin: 0; font-size: 52px; }

/* Filters */
.chips { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 28px; font-family: var(--sans); font-weight: 700; font-size: 16px; }
.chips a { text-decoration: none; padding: 10px 16px; border: 2px solid var(--ink); }
.chips a[aria-current] { background: var(--ink); color: var(--paper); }
.pagination { display: flex; flex-wrap: wrap; gap: 10px; justify-content: center; margin-top: 56px; font-family: var(--sans); font-weight: 700; }
.pagination a, .pagination span { padding: 10px 16px; border: 2px solid var(--ink); text-decoration: none; }
.pagination .current { background: var(--ink); color: var(--paper); }

/* Shortcode blocks */
.hc-facts { margin: 2em 0; }
.hc-tickets { display: grid; grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); gap: 28px; margin: 2em 0; }
.hc-ticket { border: 2px solid var(--ink); padding: 26px; display: flex; flex-direction: column; gap: 10px; font-size: 18px; }
.hc-ticket h3 { margin: 0; font-family: var(--sans); font-weight: 800; font-stretch: 80%; font-size: 30px; line-height: 1.05; }
.hc-ticket p { margin: 0; }
.hc-ticket .price { font-family: var(--sans); font-weight: 700; font-size: 20px; }
.hc-ticket .via { font-family: var(--sans); font-size: 13px; color: var(--grey); }
.hc-ticket .btn { align-self: flex-start; }
.hc-form { background: var(--wash); padding: 32px; display: flex; flex-direction: column; gap: 18px; font-family: var(--sans); margin: 2em 0; }
.hc-form h2, .hc-form h3 { margin: 0; font-weight: 800; font-stretch: 75%; font-size: 40px; line-height: 1; }
.hc-form .grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); gap: 16px; }
.hc-form fieldset { margin: 0; padding: 0; border: 0; display: flex; flex-direction: column; gap: 10px; }
.hc-form legend { font-weight: 600; font-size: 15px; margin-bottom: 8px; }
.hc-form .btn { align-self: flex-start; }
.hc-notice { padding: 14px 18px; border-left: 6px solid var(--crimson); background: var(--wash); font-family: var(--sans); font-size: 16px; }
.hc-inline-form { display: flex; flex-wrap: wrap; gap: 12px; align-items: flex-end; margin-top: 20px; }
.hc-inline-form .field { flex: 1 1 260px; }
.disclosure { font-family: var(--sans); font-size: 14px; color: var(--grey); }
.entry .hc-tickets a.btn, .entry .hc-form a.btn, .entry .visit-box a.btn { color: var(--paper); }
.entry .hc-form a { color: var(--ink); }
textarea { resize: vertical; line-height: 1.5; }
.hc-form .form-note { margin: 0; font-size: 15px; color: var(--grey); }
.entry .hc-ticket a.btn--outline { color: var(--ink); }

/* Footer */
.site-footer { background: var(--ink); color: #D6D6D6; margin-top: clamp(56px, 7vw, 96px); }
.site-footer a { color: #D6D6D6; }
.site-footer .cols { display: grid; grid-template-columns: 2fr 1fr 1fr 1fr; gap: 32px; padding-top: 56px; }
@media (max-width: 900px) { .site-footer .cols { grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); } }
.site-footer .brand { flex-wrap: wrap; }
.site-footer .brand { color: var(--paper); }
.site-footer .brand__name { font-size: 32px; }
.site-footer h2 { margin: 0 0 6px; font-family: var(--sans); font-weight: 700; font-size: 15px; color: var(--paper); }
.site-footer ul { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 8px; font-family: var(--sans); font-size: 15px; }
.site-footer .legal { padding-top: 28px; padding-bottom: 40px; font-family: var(--sans); font-size: 14px; color: #BDBDBD; }

@media (prefers-reduced-motion: no-preference) { html { scroll-behavior: smooth; } }
