/*
Theme Name: Discover Dunfermline
Theme URI: https://discoverdunfermline.co.uk/
Author: CobTech
Description: Responsive custom theme for Discover Dunfermline with admin Customizer controls for site-wide styling.
Version: 1.2.5
Requires at least: 6.0
Tested up to: 7.1
Requires PHP: 8.0
Text Domain: discover-dunfermline
*/

:root {
  --dd-bg: #f4f7f9;
  --dd-surface: #ffffff;
  --dd-text: #132231;
  --dd-accent: #0f8a92;
  --dd-link: #0a5f86;
  --dd-maxw: 1140px;
  --dd-radius: 16px;
  --dd-shadow: 0 10px 30px rgba(13, 39, 56, 0.10);
  --dd-gap: 1rem;
  --dd-main-pad-top: 1.25rem;
}

* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body {
  font-family: "Segoe UI", -apple-system, BlinkMacSystemFont, Roboto, sans-serif;
  color: var(--dd-text);
  background: var(--dd-bg-rgba, var(--dd-bg));
  line-height: 1.6;
}
body.custom-background {
  background-image: none !important;
  position: relative;
}
body.custom-background::before {
  content: "";
  position: fixed;
  inset: 0;
  z-index: -1;
  pointer-events: none;
  background-image: var(--dd-bg-image-url, none);
  background-position: center;
  background-size: cover;
  background-repeat: no-repeat;
  opacity: var(--dd-bg-image-opacity, 1);
}
a { color: var(--dd-link); }
a:hover { color: var(--dd-accent); }
.ddf-skip-link {
  position: absolute;
  left: -9999px;
  top: auto;
  width: 1px;
  height: 1px;
  overflow: hidden;
}
.ddf-skip-link:focus {
  left: 12px;
  top: 12px;
  width: auto;
  height: auto;
  z-index: 99999;
  padding: .5rem .75rem;
  border-radius: 8px;
  background: #0d7c86;
  color: #fff;
}

.site-header {
  background: var(--dd-header-bg, linear-gradient(110deg, #0f2a3a, #14415b));
  color: var(--dd-header-text, #fff);
  position: relative;
  z-index: 10;
  box-shadow: 0 5px 14px rgba(0,0,0,.16);
  backdrop-filter: blur(10px);
}
body.ddf-header-sticky .site-header {
  position: sticky;
  top: 0;
}
.site-header__inner,
.site-main,
.site-footer__inner {
  width: min(var(--dd-maxw), calc(100% - 2rem));
  margin: 0 auto;
}
.site-header__inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  min-height: var(--dd-header-size, 72px);
  padding: .35rem 0;
}
.site-header--content .site-header__inner {
  display: block;
  padding: .5rem 0;
}
.site-header__content > *:first-child { margin-top: 0; }
.site-header__content > *:last-child { margin-bottom: 0; }
.site-header__content .wp-block-group,
.site-header__content .wp-block-columns,
.site-header__content .wp-block-navigation,
.site-header__content p,
.site-header__content ul,
.site-header__content h1,
.site-header__content h2,
.site-header__content h3,
.site-header__content h4 {
  margin-top: .4rem;
  margin-bottom: .4rem;
}
.site-header__content,
.site-header__content a {
  color: var(--dd-header-text, #fff);
}
.site-header__content a:hover {
  opacity: .9;
}
.site-branding .custom-logo {
  width: auto;
  height: auto;
  max-height: var(--dd-header-logo-max-height, 56px);
}
.site-branding a { color: var(--dd-header-text, #fff); text-decoration: none; }
.site-title { margin: 0; font-size: 1.15rem; }
.site-description { margin: 0; opacity: .88; font-size: .88rem; }

.main-nav ul {
  margin: 0;
  padding: 0;
  list-style: none;
  display: flex;
  gap: .85rem;
  flex-wrap: wrap;
}
.main-nav a {
  color: var(--dd-header-text, #eaf4fa);
  text-decoration: none;
  padding: .4rem .6rem;
  border-radius: 10px;
}
.main-nav a:hover,
.main-nav .current-menu-item > a {
  background: rgba(255,255,255,.16);
}

.ddf-primary-fallback,
.ddf-quick-links-list {
  margin: 0;
  padding: 0;
  list-style: none;
  display: flex;
  flex-wrap: wrap;
  gap: .55rem;
}

.ddf-primary-fallback a,
.ddf-quick-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 40px;
  padding: .42rem .68rem;
  border-radius: 10px;
  text-decoration: none;
  font-weight: 700;
  border: 1px solid rgba(255,255,255,.2);
  color: var(--dd-header-text, #fff);
}

.ddf-primary-fallback a:hover,
.ddf-quick-link:hover,
.ddf-quick-link.is-active {
  background: rgba(255,255,255,.16);
}

.site-quick-nav {
  border-bottom: 1px solid rgba(0,0,0,.08);
  background: color-mix(in srgb, var(--dd-surface-rgba, #fff) 92%, transparent);
}

.site-quick-nav__inner {
  width: min(var(--dd-maxw), calc(100% - 2rem));
  margin: 0 auto;
  padding: .5rem 0;
}

.site-quick-nav .ddf-quick-link {
  color: var(--dd-text);
  border-color: rgba(17, 55, 78, .14);
  background: rgba(255,255,255,.72);
  font-size: .9rem;
}

.site-quick-nav .ddf-quick-link:hover,
.site-quick-nav .ddf-quick-link.is-active {
  background: rgba(13,124,134,.12);
  border-color: rgba(13,124,134,.35);
}

.site-main { padding: var(--dd-main-pad-top) 0 2.2rem; }
.ddf-home-mega-hero {
  position: relative;
  min-height: var(--dd-home-hero-height, 82vh);
  width: 100vw;
  margin-left: calc(50% - 50vw);
  margin-right: calc(50% - 50vw);
  margin-bottom: 1.2rem;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
}
.ddf-home-mega-hero::before {
  content: "";
  position: absolute;
  inset: 0;
  background-image: var(--dd-home-hero-image);
  background-size: cover;
  background-position: center;
  opacity: var(--dd-home-hero-media-opacity, 1);
}
.ddf-home-mega-hero__video {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: none;
  opacity: var(--dd-home-hero-media-opacity, 1);
}
.ddf-home-mega-hero__overlay {
  position: absolute;
  inset: 0;
  background:
    linear-gradient(120deg, rgba(10,32,49,var(--dd-home-hero-overlay,0.4)), rgba(8,69,84,calc(var(--dd-home-hero-overlay,0.4) + 0.1))),
    radial-gradient(circle at 80% 15%, rgba(255,255,255,0.16), transparent 36%);
}
.ddf-home-mega-hero__content {
  position: relative;
  width: min(var(--dd-maxw), calc(100% - 2rem));
  margin: 0 auto;
  color: #ffffff;
  text-align: left;
}
.ddf-home-mega-hero__content h1 {
  color: inherit;
  margin: 0 0 .6rem;
  font-size: clamp(2rem, 4vw, 3.4rem);
  line-height: 1.08;
  max-width: 14ch;
  text-shadow: 0 8px 24px rgba(0,0,0,.35);
}
.ddf-home-mega-hero__content p {
  color: inherit;
  margin: 0;
  font-size: clamp(1rem, 1.8vw, 1.22rem);
  max-width: 55ch;
  opacity: .96;
  text-shadow: 0 4px 18px rgba(0,0,0,.25);
}
.home .ddf-home-mega-hero + .ddf-home-shell .ddf-home-hero {
  display: none;
}
.hero {
  background: radial-gradient(circle at top right, #1b6b8f, #0f2e42);
  color: #fff;
  border-radius: calc(var(--dd-radius) + 4px);
  padding: 1.4rem;
  margin-bottom: 1.2rem;
}
.hero h1 { margin-top: 0; }
.hero p { margin-bottom: 0; opacity: .94; }

.grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: var(--dd-gap);
}
.card,
.post-card {
  background: var(--dd-surface-rgba, var(--dd-surface));
  border-radius: var(--dd-radius);
  box-shadow: var(--dd-shadow);
  padding: 1rem;
  overflow: hidden;
}
.post-card h2,
.post-card h3 { margin-top: .2rem; }
.button,
.wp-block-button__link {
  display: inline-block;
  border-radius: 12px;
  background: var(--dd-accent);
  color: #fff !important;
  text-decoration: none;
  padding: .52rem .86rem;
  border: 0;
}
.button:hover,
.wp-block-button__link:hover { filter: brightness(.95); }

.site-footer {
  border-top: 1px solid rgba(0,0,0,.08);
  background: var(--dd-footer-bg, #fff);
}
.site-footer__inner {
  padding: calc(var(--dd-footer-size, 18px) * .5) 0 var(--dd-footer-size, 18px);
  font-size: .92rem;
  color: var(--dd-footer-text, #4a6070);
}
body.ddf-footer-align-left .site-footer__inner { text-align: left; }
body.ddf-footer-align-center .site-footer__inner { text-align: center; }
body.ddf-footer-align-right .site-footer__inner { text-align: right; }
body.ddf-header-layout-centered .site-header__inner {
  flex-direction: column;
  align-items: center;
}
body.ddf-header-layout-centered .main-nav ul {
  justify-content: center;
}

body.ddf-header-solid .site-header {
  background: var(--dd-header-bg, var(--dd-accent));
}
body.ddf-header-light .site-header {
  background: var(--dd-header-bg, #fff);
  color: var(--dd-header-text, var(--dd-text));
  border-bottom: 1px solid rgba(0,0,0,.08);
}
body.ddf-header-light .site-branding a,
body.ddf-header-light .main-nav a {
  color: var(--dd-header-text, var(--dd-text));
}
body.ddf-header-light .main-nav a:hover,
body.ddf-header-light .main-nav .current-menu-item > a {
  background: rgba(15, 138, 146, .12);
}

body.ddf-buttons-pill .button,
body.ddf-buttons-pill .wp-block-button__link {
  border-radius: 999px;
}
body.ddf-buttons-sharp .button,
body.ddf-buttons-sharp .wp-block-button__link {
  border-radius: 0;
}
body.ddf-buttons-outline .button,
body.ddf-buttons-outline .wp-block-button__link {
  background: transparent;
  color: var(--dd-accent) !important;
  border: 2px solid var(--dd-accent);
}

body.ddf-type-classic {
  font-family: Georgia, "Times New Roman", serif;
}
body.ddf-type-compact {
  font-family: "Arial Narrow", Arial, "Segoe UI", sans-serif;
  letter-spacing: .01em;
}

body.ddf-density-compact {
  --dd-gap: .65rem;
  --dd-main-pad-top: .7rem;
}
body.ddf-density-compact .card,
body.ddf-density-compact .post-card {
  padding: .8rem;
}

@media (max-width: 900px) {
  .grid { grid-template-columns: 1fr; }
  .ddf-home-mega-hero {
    min-height: min(78vh, var(--dd-home-hero-height, 82vh));
  }
}
@media (max-width: 720px) {
  .site-header__inner { flex-direction: column; align-items: flex-start; }
  .main-nav ul { gap: .5rem; }
  .site-quick-nav__inner { overflow-x: auto; padding-bottom: .2rem; }
  .site-quick-nav .ddf-quick-links-list { flex-wrap: nowrap; min-width: max-content; }
  .site-main { padding-top: .9rem; }
  body.ddf-header-layout-centered .site-header__inner {
    align-items: center;
  }
}
