@import url('https://fonts.googleapis.com/css2?family=Fraunces:opsz,wght@9..144,400;9..144,500;9..144,600;9..144,700&family=Inter:wght@400;500;600;700&display=swap');

/* ============================================================
   CROESO TEMPLATE v2  —  Ruthin.com
   Theme: "Rhuddyn Red" — the red sandstone of Ruthin Castle
   (Rhuddyn = "red fortress", the origin of the town's name)
   with an antique-gold accent for its market-town, medieval
   character. Same visual language as ruabon.com / colwyn.org.uk,
   applied to Ruthin's existing markup/class names.
   ============================================================ */

:root {
  --primary:       #8a3327;
  --primary-light: #b2543f;
  --primary-dark:  #4a1c16;
  --accent:        #c9a227;
  --accent-2:      #dbb941;
  --gold:          #c9a227;
  --navy:          #4a1c16;   /* legacy alias used by older inline styles */
  --teal:          #8a3327;   /* legacy alias */
  --coral:         #c9a227;   /* legacy alias */
  --text:          #241a16;
  --ink:           #241a16;   /* legacy alias */
  --text-light:    #6d5c53;
  --slate:         #6d5c53;   /* legacy alias */
  --sand:          #f7f0e5;
  --stone:         #f2e8d8;
  --light-bg:      #efe1cb;
  --sky:           #f2e8d8;   /* legacy alias */
  --border:        #e3d2b8;
  --white:         #fff;
  --cream:         #fffdf9;
  --max-width:     1180px;
  --box-width:     1040px;
  --radius:        16px;
  --radius-sm:     10px;
  --shadow-sm:     0 1px 2px rgba(74,28,22,.07), 0 2px 8px rgba(74,28,22,.07);
  --shadow-md:     0 6px 24px rgba(74,28,22,.12);
  --shadow-lg:     0 24px 60px rgba(74,28,22,.20);
  --font-body:     'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
  --font-heading:  'Fraunces', Georgia, serif;
  --ease:          cubic-bezier(.22,.61,.36,1);
}

/* ---------- Reset & base ---------- */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; overflow-x: hidden; }
body {
  font-family: var(--font-body);
  font-size: 17px;
  line-height: 1.75;
  color: var(--text);
  background: var(--cream);
  overflow-x: hidden;
  max-width: 100%;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}
img { max-width: 100%; height: auto; display: block; }
a { color: var(--primary); text-decoration: none; border-bottom: 1px solid rgba(138,51,39,.28); transition: color .15s, border-color .15s; }
a:hover { color: var(--accent); border-bottom-color: var(--accent); }
h1, h2, h3, h4 { font-family: var(--font-heading); color: var(--primary-dark); line-height: 1.18; letter-spacing: -.01em; font-weight: 600; margin: 0 0 .5em; }
strong { font-weight: 600; }
em { font-style: italic; }
ul, ol { margin: .6rem 0 1rem 1.5rem; }
li { margin-bottom: .3rem; }

/* ---------- Header ---------- */
.site-header {
  background: rgba(247,240,229,.86);
  backdrop-filter: saturate(1.3) blur(14px);
  -webkit-backdrop-filter: saturate(1.3) blur(14px);
  position: sticky;
  top: 0;
  z-index: 100;
  border-bottom: 1px solid var(--border);
  box-shadow: 0 1px 12px rgba(74,28,22,.05);
}
.header-band {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 14px 24px;
  display: flex;
  align-items: baseline;
  gap: 14px;
  flex-wrap: wrap;
}
.header-band img { align-self: center; }
.site-logo {
  font-family: var(--font-heading);
  font-weight: 600;
  font-size: 1.7rem;
  line-height: 1;
  color: var(--primary-dark);
  text-decoration: none;
  border-bottom: none;
  letter-spacing: -.01em;
  white-space: nowrap;
}
.site-logo span { color: var(--primary); }
.site-strapline {
  font-family: var(--font-heading);
  font-style: italic;
  font-size: .88rem;
  color: var(--text-light);
  white-space: nowrap;
  margin: 0;
}

/* ---------- Navigation ---------- */
.main-nav ul {
  max-width: var(--max-width);
  margin: 0 auto;
  list-style: none;
  display: flex;
  flex-wrap: wrap;
  gap: 3px;
  padding: 0 24px 12px;
}
.main-nav li { position: relative; }
.main-nav li a {
  display: inline-block;
  padding: 8px 15px;
  border-radius: 999px;
  color: var(--text);
  text-decoration: none;
  border-bottom: none;
  font-weight: 600;
  font-size: .87rem;
  letter-spacing: .01em;
  white-space: nowrap;
  transition: background .2s var(--ease), color .2s var(--ease);
}
.main-nav li a:hover,
.main-nav li a.active {
  background: var(--primary);
  color: #fff;
}

/* ---------- Mobile nav toggle ---------- */
.nav-toggle {
  display: none;
  flex-direction: column;
  justify-content: space-between;
  width: 28px; height: 20px;
  background: none; border: none; cursor: pointer; padding: 0;
  position: absolute;
  top: 50%;
  right: 24px;
  transform: translateY(-50%);
}
.nav-toggle span {
  display: block; height: 2px; background: var(--primary-dark); border-radius: 2px;
  transition: transform .2s, opacity .2s;
}
.nav-toggle[aria-expanded="true"] span:nth-child(1) { transform: translateY(9px) rotate(45deg); }
.nav-toggle[aria-expanded="true"] span:nth-child(2) { opacity: 0; }
.nav-toggle[aria-expanded="true"] span:nth-child(3) { transform: translateY(-9px) rotate(-45deg); }

/* ---------- Hero ---------- */
.page-hero {
  position: relative;
  width: 100%;
  height: 320px;
  overflow: hidden;
  background: var(--primary-dark);
  display: flex;
  align-items: flex-end;
}
.page-hero.has-image .hero-img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center;
  transform: scale(1.04);
  animation: heroZoom 20s var(--ease) forwards;
}
@keyframes heroZoom { to { transform: scale(1); } }
.page-hero.has-image::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, rgba(30,12,8,.10) 0%, rgba(30,12,8,.42) 55%, rgba(30,12,8,.86) 100%);
}
.page-hero:not(.has-image) {
  background: linear-gradient(135deg, var(--primary-dark), var(--primary));
}
.page-hero:not(.has-image)::before {
  content: "";
  position: absolute;
  top: -50%; right: -8%;
  width: 460px; height: 460px;
  background: radial-gradient(circle, rgba(201,162,39,.22), transparent 70%);
}
.page-hero .hero-overlay {
  position: relative;
  z-index: 2;
  width: 100%;
  padding: 34px 24px 34px;
  max-width: var(--max-width);
  margin: 0 auto;
}
.page-hero .hero-overlay h1 {
  color: #fff;
  font-size: clamp(1.9rem, 4vw, 2.7rem);
  text-shadow: 0 2px 20px rgba(0,0,0,.35);
  margin-bottom: 0;
}
.hero-sub {
  color: rgba(255,255,255,.9);
  font-size: 1.05rem;
  font-style: italic;
  font-family: var(--font-heading);
  margin-top: 8px;
  text-shadow: 0 1px 10px rgba(0,0,0,.4);
}
.hero-distances {
  font-size: .92rem;
  color: rgba(255,255,255,.88);
  margin-top: 12px;
  letter-spacing: .01em;
  text-shadow: 0 1px 8px rgba(0,0,0,.7);
}
.hero-distances a { font-weight: 700; }
.page-hero a, .page-hero a:link, .page-hero a:visited {
  color: #fff;
  border-bottom: 1px solid rgba(255,255,255,.5);
  text-shadow: 0 1px 6px rgba(0,0,0,.5);
}
.page-hero a:hover { color: var(--accent-2); border-bottom-color: var(--accent-2); }

/* Home hero — taller, larger type */
.page-hero.home-hero { height: 62vh; min-height: 460px; }
.page-hero.home-hero .hero-overlay { padding-bottom: 46px; }
.page-hero.home-hero .hero-overlay h1 { font-size: clamp(2.4rem, 6vw, 3.8rem); font-weight: 600; }

.page-hero.honest-hero { background: linear-gradient(135deg, #2c110c, var(--primary-dark)); }

/* ---------- Breadcrumb ---------- */
.breadcrumb { background: var(--stone); border-bottom: 1px solid var(--border); padding: .5rem 24px; }
.breadcrumb ol { list-style: none; display: flex; flex-wrap: wrap; gap: 0; margin: 0; padding: 0; font-size: .8rem; max-width: var(--max-width); margin: 0 auto; }
.breadcrumb li { display: flex; align-items: center; color: var(--text-light); }
.breadcrumb li + li::before { content: "›"; margin: 0 .5rem; color: #b7a689; }
.breadcrumb a { color: var(--primary); text-decoration: none; border-bottom: none; font-weight: 500; }
.breadcrumb a:hover { color: var(--accent); }
.breadcrumb span[aria-current] { color: var(--primary-dark); font-weight: 600; }

/* ---------- Main content wrapper ---------- */
.page-wrap {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 3rem 1.5rem 5rem;
}
.page-wrap.honest-content { max-width: 820px; }

h2 {
  font-size: 1.7rem;
  margin: 2.6rem 0 1rem;
  position: relative;
  padding-left: 0;
}
h2::after { content: ""; display: block; width: 52px; height: 3px; background: var(--accent); border-radius: 2px; margin-top: 10px; }
h3 { font-size: 1.15rem; margin: 1.5rem 0 .5rem; color: var(--primary-dark); }
p { margin-bottom: 1.1rem; }
p.intro {
  font-family: var(--font-heading);
  font-size: 1.2rem;
  font-weight: 400;
  color: var(--text);
  border-left: 4px solid var(--accent);
  padding-left: 1.2rem;
  margin-bottom: 2.2rem;
  line-height: 1.6;
}
.honest-content h2 { color: #6e2416; }
.honest-content h2::after { background: var(--primary); }
.honest-content p.intro { border-left-color: var(--primary); }

/* ---------- Facts table ---------- */
.facts-table {
  width: 100%;
  border-collapse: collapse;
  margin: 1.2rem 0 1.8rem;
  font-size: .95rem;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  overflow: hidden;
}
.facts-table th, .facts-table td {
  padding: .7rem 1rem;
  text-align: left;
  border-bottom: 1px solid var(--border);
  vertical-align: top;
}
.facts-table th {
  width: 34%;
  font-family: var(--font-heading);
  font-weight: 600;
  font-size: .8rem;
  letter-spacing: .03em;
  text-transform: uppercase;
  color: var(--text-light);
  background: var(--stone);
}
.facts-table tr:last-child th, .facts-table tr:last-child td { border-bottom: none; }

/* ---------- Quick nav grid (home page) — image cards, like Denbigh/Colwyn ---------- */
.quick-nav-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 22px;
  margin: 1.8rem 0 2.6rem;
}
.img-card {
  display: flex;
  flex-direction: column;
  background: var(--white);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  text-decoration: none;
  border-bottom: none;
  color: var(--text);
  box-shadow: var(--shadow-sm);
  transition: transform .25s var(--ease), box-shadow .25s var(--ease);
}
.img-card:hover { transform: translateY(-5px); box-shadow: var(--shadow-md); }
.card-img-wrap { aspect-ratio: 16/9; overflow: hidden; background: var(--light-bg); }
.card-img-wrap img { width: 100%; height: 100%; object-fit: cover; display: block; transition: transform .5s var(--ease); }
.img-card:hover .card-img-wrap img { transform: scale(1.07); }
.card-body { padding: 14px 20px 20px; }
.card-body h3 { font-size: 1.1rem; margin: 0 0 4px; color: var(--primary-dark); }
.card-body p { font-size: .87rem; color: var(--text-light); margin: 0 0 10px; }
.card-arrow { font-size: .85rem; font-weight: 700; color: var(--primary); }
.img-card:hover .card-arrow { color: var(--accent); }

/* ---------- Booking widget ---------- */
.booking { background: var(--white); border: 1px solid var(--border); border-radius: var(--radius); box-shadow: var(--shadow-md); padding: 34px 40px; max-width: var(--max-width); margin: 26px auto; position: relative; overflow: hidden; box-sizing: border-box; }
.booking::before { content: ""; position: absolute; top: 0; left: 0; width: 100%; height: 4px; background: linear-gradient(90deg, var(--accent), var(--accent-2)); }
.booking h3 { font-family: var(--font-heading); font-weight: 600; font-size: clamp(1.4rem, 2.4vw, 1.9rem); color: var(--primary-dark); margin: 0 0 6px; }
.booking .bk-sub { color: var(--text-light); margin-bottom: 20px; }
@media (max-width: 560px) { .booking { padding: 24px 20px; } }

/* ---------- Generic content image figures (inline, within body copy) ---------- */
.page-hero-figure { width: 100%; margin: 2rem 0; }
.page-hero-figure img { width: 100%; max-height: 420px; object-fit: cover; border-radius: var(--radius); box-shadow: var(--shadow-sm); }
.page-hero-figure figcaption { font-size: .8rem; color: var(--text-light); padding: 8px 4px 0; text-align: right; }
.float-fig { float: right; width: 300px; max-width: calc(40% - 20px); margin: 4px 0 20px 24px; border-radius: var(--radius-sm); overflow: hidden; box-shadow: var(--shadow-sm); box-sizing: border-box; }
.float-fig.float-left { float: left; margin: 4px 24px 20px 0; }
.float-fig img { width: 100%; display: block; }
.float-fig figcaption { padding: 8px 12px; text-align: left; background: var(--white); font-size: .78rem; color: var(--text-light); }
@media (max-width: 700px) {
  .float-fig, .float-fig.float-left { float: none; width: 100%; max-width: 100%; margin: 8px 0 20px; }
}

/* ---------- Buttons ---------- */
.btn-primary, .btn-secondary {
  display: inline-block;
  padding: .8rem 1.7rem;
  border-radius: 999px;
  font-family: var(--font-body);
  font-weight: 700;
  font-size: .92rem;
  text-decoration: none;
  border-bottom: none;
  transition: transform .15s var(--ease), box-shadow .2s var(--ease), background .2s;
}
.btn-primary { background: var(--accent); color: var(--primary-dark); }
.btn-primary:hover { color: var(--primary-dark); transform: translateY(-2px); box-shadow: 0 10px 26px rgba(201,162,39,.4); }
.btn-secondary { background: rgba(255,255,255,.14); color: #fff; border: 1px solid rgba(255,255,255,.35); }
.btn-secondary:hover { color: #fff; background: rgba(255,255,255,.22); transform: translateY(-2px); }

/* ---------- FAQ ---------- */
.faq-section { margin: 3.2rem 0 1rem; border-top: 2px solid var(--accent); padding-top: 1.6rem; }
.faq-section h2 { font-size: 1.35rem; margin-top: 0; }
.faq-section h2::after { display: none; }
.faq-item { border-bottom: 1px solid var(--border); }
.faq-q {
  list-style: none;
  cursor: pointer;
  padding: .95rem 2rem .95rem 0;
  font-weight: 600;
  font-family: var(--font-heading);
  color: var(--primary-dark);
  position: relative;
  font-size: 1.02rem;
  line-height: 1.4;
}
.faq-q::-webkit-details-marker { display: none; }
.faq-q::after {
  content: '+';
  position: absolute;
  right: 0; top: 50%;
  transform: translateY(-50%);
  font-size: 1.3rem;
  color: var(--accent);
  transition: transform .2s;
}
details[open] > .faq-q::after { content: '\2212'; }
.faq-a { padding: .25rem 0 1.1rem; color: var(--text); font-size: .97rem; line-height: 1.65; }

/* ---------- Related guides ---------- */
.related-guides {
  margin-top: 2.6rem;
  padding: 1.3rem 1.5rem;
  background: var(--stone);
  border-left: 3px solid var(--primary);
  border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
}
.related-guides h3 {
  font-size: .78rem; font-family: var(--font-body); font-weight: 700;
  text-transform: uppercase; letter-spacing: .08em; color: var(--primary);
  margin-bottom: .8rem; margin-top: 0;
}
.related-links { display: flex; flex-wrap: wrap; gap: .6rem; }
.related-links a {
  display: inline-block; padding: .4rem .95rem; background: #fff;
  border: 1px solid var(--border); border-radius: 999px; font-size: .85rem;
  color: var(--primary-dark); text-decoration: none; border-bottom: none;
  font-weight: 600; transition: background .15s, color .15s, border-color .15s;
}
.related-links a:hover { background: var(--primary); color: #fff; border-color: var(--primary); }

/* ---------- AEO badge ---------- */
.aeo-badge {
  display: inline-flex; align-items: center; gap: .35rem;
  margin-top: 2.5rem; padding: .3rem .8rem .3rem .65rem;
  background: var(--stone); border: 1px solid var(--border); border-radius: 999px;
  font-size: .7rem; color: var(--text-light); font-weight: 600;
  letter-spacing: .06em; text-transform: uppercase;
}
.aeo-icon { color: var(--primary); font-size: .75rem; }

/* ---------- 404 / sitemap ---------- */
.p404-hero {
  background: linear-gradient(135deg, var(--primary-dark), var(--primary));
  padding: 3.6rem 1.5rem 2.6rem;
  text-align: center;
  color: #fff;
  position: relative;
  overflow: hidden;
}
.p404-hero::before {
  content: "";
  position: absolute; top: -50%; right: -10%;
  width: 480px; height: 480px;
  background: radial-gradient(circle, rgba(201,162,39,.22), transparent 70%);
}
.p404-code {
  position: relative; z-index: 1;
  font-family: var(--font-heading);
  font-size: 5rem; font-weight: 600; line-height: 1;
  color: var(--accent-2); letter-spacing: -.02em;
}
.p404-headline {
  position: relative; z-index: 1;
  font-family: var(--font-heading);
  font-size: 1.8rem; font-weight: 600; margin: .6rem 0 .4rem;
  color: #fff;
}
.p404-sub {
  position: relative; z-index: 1;
  font-size: 1.05rem; color: rgba(255,255,255,.82);
  max-width: 520px; margin: 0 auto 1.6rem;
}
.p404-actions { position: relative; z-index: 1; display: flex; gap: .8rem; justify-content: center; flex-wrap: wrap; margin-top: 1.2rem; }
.p404-sitemap { max-width: var(--max-width); margin: 0 auto; padding: 2.8rem 1.5rem 3.5rem; }
.p404-sitemap h2 {
  font-size: 1.15rem; text-transform: uppercase; letter-spacing: .07em;
  color: var(--primary); margin-bottom: 1.6rem; border-bottom: 2px solid var(--border);
  padding-bottom: .7rem; font-family: var(--font-body); font-weight: 700;
}
.p404-sitemap h2::after { display: none; }
.map-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 1.8rem; }
.map-section {
  background: var(--white); border: 1px solid var(--border); border-radius: var(--radius);
  padding: 1.3rem 1.4rem; box-shadow: var(--shadow-sm);
}
.map-section h3 {
  font-family: var(--font-heading); font-size: .95rem; font-weight: 600;
  color: var(--primary-dark); margin-bottom: .7rem; margin-top: 0;
}
.map-section ul { list-style: none; margin: 0; padding: 0; }
.map-section ul li { margin-bottom: .35rem; }
.map-section ul li a { font-size: .93rem; color: var(--text); text-decoration: none; border-bottom: none; }
.map-section ul li a:hover { color: var(--primary); }

/* ---------- Footer ---------- */
.site-footer { background: var(--primary-dark); color: rgba(255,255,255,.78); font-size: .9rem; margin-top: 3rem; }
.footer-inner {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 3rem 24px 1.6rem;
  display: grid;
  grid-template-columns: 2fr 1fr 1fr;
  gap: 2.2rem;
}
.footer-col h4 {
  font-family: var(--font-body); font-size: .74rem; font-weight: 700;
  letter-spacing: .12em; text-transform: uppercase; color: var(--accent-2);
  margin-bottom: .9rem;
}
.footer-col p { color: rgba(255,255,255,.68); line-height: 1.6; margin-bottom: .6rem; font-size: .9rem; }
.footer-col ul { list-style: none; margin: 0; padding: 0; }
.footer-col ul li { margin-bottom: .45rem; }
.footer-col ul li a { color: rgba(255,255,255,.72); text-decoration: none; border-bottom: none; transition: color .15s; }
.footer-col ul li a:hover { color: var(--accent-2); }
.footer-current { color: var(--accent-2); font-weight: 600; cursor: default; }

.network-band { background: rgba(0,0,0,.16); border-top: 1px solid rgba(255,255,255,.1); }
.network-band-inner { max-width: var(--max-width); margin: 0 auto; padding: 1.5rem 24px; }
.network-band-inner h5 {
  font-family: var(--font-body); font-size: .74rem; font-weight: 700;
  letter-spacing: .1em; text-transform: uppercase; color: rgba(255,255,255,.6);
  margin-bottom: .8rem;
}
.network-links { display: flex; flex-wrap: wrap; gap: 6px; }
.network-links a {
  display: inline-block; padding: 5px 13px; background: rgba(255,255,255,.06);
  border: 1px solid rgba(255,255,255,.12); border-radius: 999px;
  font-size: .8rem; color: rgba(255,255,255,.75); text-decoration: none;
  border-bottom: none; transition: background .15s, color .15s, border-color .15s;
}
.network-links a:hover { background: var(--accent); color: var(--primary-dark); border-color: var(--accent); }

.footer-bottom {
  max-width: var(--max-width); margin: 0 auto; padding: 1.1rem 24px;
  border-top: 1px solid rgba(255,255,255,.1);
  display: flex; justify-content: space-between; align-items: center;
  flex-wrap: wrap; gap: .5rem;
  font-size: .82rem; color: rgba(255,255,255,.55);
}
.footer-bottom a { color: rgba(255,255,255,.75); border-bottom: none; }
.footer-bottom a:hover { color: var(--accent-2); }

/* ---------- Responsive ---------- */
@media (max-width: 980px) {
  .site-strapline { display: none; }
  .header-band { padding-right: 64px; }
  .header-band img[style*="margin-left"] { display: none; }
  .nav-toggle { display: flex; z-index: 210; }
  .main-nav {
    display: none;
    position: fixed;
    inset: 0;
    top: 0;
    background: var(--cream);
    padding: 90px 24px 30px;
    overflow-y: auto;
    z-index: 200;
  }
  .main-nav.nav-open { display: block; }
  .main-nav ul { flex-direction: column; gap: 4px; padding: 0; max-width: none; }
  .main-nav li a { display: block; padding: 13px 16px; border-radius: 10px; font-size: .95rem; }
  .quick-nav-grid { grid-template-columns: repeat(2, 1fr); }
  .footer-inner { grid-template-columns: 1fr; }
  .map-grid { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 560px) {
  body { font-size: 16px; }
  .site-logo { font-size: 1.4rem; }
  .page-hero { height: 260px; }
  .page-hero.home-hero { height: 52vh; min-height: 380px; }
  .page-wrap { padding: 2.2rem 1.2rem 4rem; }
  .quick-nav-grid { grid-template-columns: 1fr 1fr; }
  .p404-code { font-size: 3.5rem; }
  .p404-headline { font-size: 1.4rem; }
  .map-grid { grid-template-columns: 1fr; }
  .footer-bottom { flex-direction: column; text-align: center; }
}
