/*
Theme Name: Odense NV
Theme URI: https://odensenv.dk
Author: DKM Design / Jesper Absalonsen
Author URI: https://odensenv.dk
Description: Et moderne, lokalsamfunds-tema til Odense NV — lyst, blåt og indbydende. Bygget til Gutenberg Blocks med fuld-bredde layouts, responsiv header og redigerbar footer.
Version: 1.0.0
Requires at least: 6.3
Tested up to: 6.7
Requires PHP: 8.0
License: GNU General Public License v2 or later
License URI: https://www.gnu.org/licenses/gpl-2.0.html
Text Domain: odensenv
Tags: gutenberg, block-styles, full-site-editing, custom-menu, widget-areas, translation-ready

Odense NV Theme — DKM Design, 2024
*/

/* ==============================
   CSS CUSTOM PROPERTIES
============================== */
:root {
  --color-sky:        #B8D9E8;
  --color-ocean:      #2A5F7A;
  --color-deep:       #1A3345;
  --color-bg:         #F0F7FA;
  --color-white:      #FFFFFF;
  --color-muted:      #6A8FA3;
  --color-border:     #D0E8F2;
  --color-hover:      #1E4D63;

  --font-heading:     'DM Serif Display', Georgia, serif;
  --font-body:        'Inter', system-ui, sans-serif;

  --size-xs:   0.75rem;
  --size-sm:   0.875rem;
  --size-base: 1rem;
  --size-md:   1.125rem;
  --size-lg:   1.375rem;
  --size-xl:   1.75rem;
  --size-2xl:  2.25rem;
  --size-3xl:  3rem;
  --size-4xl:  3.75rem;

  --radius-sm:  4px;
  --radius-md:  8px;
  --radius-lg:  16px;

  --shadow-sm:  0 1px 3px rgba(26,51,69,.08);
  --shadow-md:  0 4px 16px rgba(26,51,69,.12);
  --shadow-lg:  0 8px 32px rgba(26,51,69,.16);

  --max-width:        1200px;
  --content-width:    720px;
  --header-height:    72px;

  --transition: 0.22s ease;
}

/* ==============================
   RESET & BASE
============================== */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  scroll-behavior: smooth;
  -webkit-text-size-adjust: 100%;
}

body {
  font-family: var(--font-body);
  font-size: var(--size-base);
  line-height: 1.65;
  color: var(--color-deep);
  background-color: var(--color-bg);
  -webkit-font-smoothing: antialiased;
}

img, video {
  max-width: 100%;
  height: auto;
  display: block;
}

a {
  color: var(--color-ocean);
  text-decoration: none;
  transition: color var(--transition);
}
a:hover, a:focus-visible {
  color: var(--color-hover);
  text-decoration: underline;
}

:focus-visible {
  outline: 2px solid var(--color-ocean);
  outline-offset: 3px;
  border-radius: var(--radius-sm);
}

/* ==============================
   TYPOGRAPHY
============================== */
h1, h2, h3, h4, h5, h6 {
  font-family: var(--font-heading);
  line-height: 1.2;
  color: var(--color-deep);
  font-weight: 400;
}

h1 { font-size: clamp(var(--size-2xl), 5vw, var(--size-4xl)); }
h2 { font-size: clamp(var(--size-xl),  4vw, var(--size-3xl)); }
h3 { font-size: clamp(var(--size-lg),  3vw, var(--size-2xl)); }
h4 { font-size: var(--size-xl); }
h5 { font-size: var(--size-lg); }
h6 { font-size: var(--size-md); }

p { max-width: 72ch; margin-bottom: 1.2em; }
p:last-child { margin-bottom: 0; }

ul, ol { padding-left: 1.5em; }
li { margin-bottom: 0.4em; }

blockquote {
  border-left: 3px solid var(--color-sky);
  padding: 1rem 1.5rem;
  margin: 1.5rem 0;
  font-style: italic;
  color: var(--color-ocean);
  background: var(--color-white);
  border-radius: 0 var(--radius-md) var(--radius-md) 0;
}

/* ==============================
   LAYOUT HELPERS
============================== */
.container {
  max-width: var(--max-width);
  margin-inline: auto;
  padding-inline: clamp(1rem, 4vw, 2.5rem);
}

.container--narrow {
  max-width: var(--content-width);
  margin-inline: auto;
  padding-inline: clamp(1rem, 4vw, 2.5rem);
}

.section {
  padding-block: clamp(3rem, 7vw, 6rem);
}

.section--flush {
  padding-block: 0;
}

/* ==============================
   SKIP LINK (ACCESSIBILITY)
============================== */
.skip-link {
  position: absolute;
  top: -100%;
  left: 1rem;
  background: var(--color-ocean);
  color: var(--color-white);
  padding: 0.5rem 1rem;
  border-radius: 0 0 var(--radius-md) var(--radius-md);
  font-size: var(--size-sm);
  z-index: 9999;
  transition: top var(--transition);
}
.skip-link:focus { top: 0; }

/* ==============================
   HEADER
============================== */
#site-header {
  position: sticky;
  top: 0;
  left: 0;
  right: 0;
  height: var(--header-height);
  background: rgba(255,255,255,0.92);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--color-border);
  z-index: 100;
  transition: background var(--transition), box-shadow var(--transition);
}

#site-header.scrolled {
  background: rgba(255,255,255,0.98);
  box-shadow: var(--shadow-md);
}

.header__inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 100%;
  gap: 1.5rem;
}

/* Logo */
.site-branding {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  flex-shrink: 0;
}

.site-branding__badge {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 42px;
  height: 42px;
  background: var(--color-ocean);
  border-radius: var(--radius-md);
  color: var(--color-white);
  font-family: var(--font-heading);
  font-size: var(--size-lg);
  line-height: 1;
  letter-spacing: -0.02em;
  flex-shrink: 0;
}

.site-branding__text {
  display: flex;
  flex-direction: column;
  line-height: 1.1;
}

.site-title {
  font-family: var(--font-heading);
  font-size: var(--size-lg);
  color: var(--color-deep);
  text-decoration: none;
  font-weight: 400;
}
.site-title:hover { color: var(--color-ocean); text-decoration: none; }

.site-description {
  font-size: var(--size-xs);
  color: var(--color-muted);
  letter-spacing: 0.03em;
}

/* Primary Navigation */
#primary-navigation {
  display: flex;
  align-items: center;
}

.primary-menu {
  display: flex;
  list-style: none;
  padding: 0;
  margin: 0;
  gap: 0.25rem;
}

.primary-menu > li > a {
  display: block;
  padding: 0.4rem 0.8rem;
  font-size: var(--size-sm);
  font-weight: 500;
  color: var(--color-deep);
  border-radius: var(--radius-sm);
  transition: background var(--transition), color var(--transition);
  text-decoration: none;
}

.primary-menu > li > a:hover,
.primary-menu > li.current-menu-item > a,
.primary-menu > li.current-page-ancestor > a {
  background: var(--color-bg);
  color: var(--color-ocean);
}

/* Mobile Menu Toggle */
.menu-toggle {
  display: none;
  align-items: center;
  justify-content: center;
  width: 42px;
  height: 42px;
  background: none;
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  cursor: pointer;
  color: var(--color-deep);
  transition: background var(--transition);
  flex-shrink: 0;
}
.menu-toggle:hover { background: var(--color-bg); }

.menu-toggle__bars {
  display: flex;
  flex-direction: column;
  gap: 5px;
}
.menu-toggle__bars span {
  display: block;
  width: 20px;
  height: 2px;
  background: currentColor;
  border-radius: 2px;
  transition: transform var(--transition), opacity var(--transition);
}

.menu-toggle[aria-expanded="true"] .menu-toggle__bars span:nth-child(1) {
  transform: translateY(7px) rotate(45deg);
}
.menu-toggle[aria-expanded="true"] .menu-toggle__bars span:nth-child(2) {
  opacity: 0;
}
.menu-toggle[aria-expanded="true"] .menu-toggle__bars span:nth-child(3) {
  transform: translateY(-7px) rotate(-45deg);
}

/* ==============================
   HERO
============================== */
.site-hero {
  position: relative;
  min-height: clamp(400px, 70vh, 680px);
  display: flex;
  align-items: flex-end;
  overflow: hidden;
  background: var(--color-ocean);
}

.site-hero__bg {
  position: absolute;
  inset: 0;
  background-size: cover;
  background-position: center;
  background-repeat: no-repeat;
  transition: transform 0.6s ease;
}

.site-hero__overlay {
  position: absolute;
  inset: 0;
  background: linear-gradient(
    to top,
    rgba(26,51,69,0.80) 0%,
    rgba(26,51,69,0.30) 55%,
    rgba(26,51,69,0.08) 100%
  );
}

.site-hero__content {
  position: relative;
  padding-block: clamp(2.5rem, 5vw, 4rem);
  color: var(--color-white);
  max-width: var(--max-width);
  padding-inline: clamp(1rem, 4vw, 2.5rem);
  margin-inline: auto;
  width: 100%;
}

/* Byskilt / sign element */
.hero-sign {
  display: inline-block;
  margin-bottom: 1.25rem;
}

.hero-sign__inner {
  display: inline-flex;
  flex-direction: column;
  align-items: center;
  background: var(--color-white);
  color: var(--color-deep);
  border: 4px solid var(--color-deep);
  border-radius: var(--radius-sm);
  padding: 0.5rem 1.5rem 0.6rem;
  box-shadow: 4px 4px 0 var(--color-deep);
  min-width: 200px;
}

.hero-sign__welcome {
  font-size: var(--size-xs);
  letter-spacing: 0.15em;
  text-transform: uppercase;
  color: var(--color-ocean);
  font-family: var(--font-body);
  font-weight: 600;
  margin-bottom: 0.1rem;
}

.hero-sign__city {
  font-family: var(--font-heading);
  font-size: clamp(1.5rem, 4vw, 2.5rem);
  line-height: 1.1;
  color: var(--color-deep);
  font-weight: 400;
}

.hero-sign__city span {
  display: block;
  font-size: 0.6em;
  color: var(--color-ocean);
  letter-spacing: 0.08em;
}

.site-hero__title {
  font-size: clamp(var(--size-xl), 4vw, var(--size-3xl));
  color: var(--color-white);
  margin-bottom: 0.75rem;
  text-shadow: 0 1px 4px rgba(0,0,0,0.3);
}

.site-hero__description {
  font-size: var(--size-md);
  color: rgba(255,255,255,0.88);
  max-width: 52ch;
  line-height: 1.6;
}

/* ==============================
   MAIN CONTENT AREA
============================== */
#main-content {
  min-height: 60vh;
}

/* Gutenberg alignment fixes */
.wp-block-group.alignfull,
.wp-block-cover.alignfull,
.wp-block-image.alignfull {
  margin-inline: calc(-1 * clamp(1rem, 4vw, 2.5rem));
}

.entry-content {
  padding-block: clamp(2rem, 5vw, 4rem);
}

.entry-content > * + * {
  margin-top: 1.5rem;
}

.entry-content h2,
.entry-content h3 {
  margin-top: 2.5rem;
}

/* ==============================
   GUTENBERG BLOCK STYLES
============================== */

/* Buttons */
.wp-block-button__link,
.wp-block-buttons .wp-block-button__link {
  font-family: var(--font-body);
  font-weight: 500;
  font-size: var(--size-sm);
  border-radius: var(--radius-md) !important;
  padding: 0.65rem 1.4rem !important;
  transition: background var(--transition), transform var(--transition), box-shadow var(--transition);
}

.is-style-fill .wp-block-button__link {
  background: var(--color-ocean);
  color: var(--color-white);
}
.is-style-fill .wp-block-button__link:hover {
  background: var(--color-hover);
  box-shadow: var(--shadow-md);
  text-decoration: none;
}

.is-style-outline .wp-block-button__link {
  background: transparent;
  color: var(--color-ocean);
  border: 2px solid var(--color-ocean);
}
.is-style-outline .wp-block-button__link:hover {
  background: var(--color-ocean);
  color: var(--color-white);
  text-decoration: none;
}

/* Columns */
.wp-block-columns {
  gap: 1.5rem !important;
}

/* Cover */
.wp-block-cover {
  border-radius: var(--radius-lg);
  overflow: hidden;
}

/* Pullquote */
.wp-block-pullquote {
  border-color: var(--color-ocean) !important;
  color: var(--color-ocean);
}

/* Separator */
.wp-block-separator {
  border-color: var(--color-border) !important;
  opacity: 1 !important;
}

/* Table */
.wp-block-table td, .wp-block-table th {
  border-color: var(--color-border) !important;
}
.wp-block-table thead {
  background: var(--color-bg);
}

/* Code */
.wp-block-code, pre {
  background: var(--color-deep);
  color: var(--color-sky);
  border-radius: var(--radius-md);
  padding: 1.25rem 1.5rem;
  font-size: var(--size-sm);
  overflow-x: auto;
}

/* ==============================
   CARDS / POSTS GRID
============================== */
.posts-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(min(300px, 100%), 1fr));
  gap: 1.5rem;
}

.card {
  background: var(--color-white);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-lg);
  overflow: hidden;
  transition: box-shadow var(--transition), transform var(--transition);
  display: flex;
  flex-direction: column;
}
.card:hover {
  box-shadow: var(--shadow-lg);
  transform: translateY(-2px);
}

.card__image {
  aspect-ratio: 16/9;
  overflow: hidden;
}
.card__image img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.4s ease;
}
.card:hover .card__image img {
  transform: scale(1.03);
}

.card__body {
  padding: 1.25rem 1.5rem 1.5rem;
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.card__category {
  font-size: var(--size-xs);
  font-weight: 600;
  color: var(--color-ocean);
  letter-spacing: 0.04em;
}

.card__title {
  font-family: var(--font-heading);
  font-size: var(--size-lg);
  line-height: 1.25;
  color: var(--color-deep);
}
.card__title a {
  color: inherit;
  text-decoration: none;
}
.card__title a:hover { color: var(--color-ocean); }

.card__excerpt {
  font-size: var(--size-sm);
  color: var(--color-muted);
  line-height: 1.6;
  flex: 1;
}

.card__footer {
  margin-top: auto;
  padding-top: 1rem;
  border-top: 1px solid var(--color-border);
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: var(--size-xs);
  color: var(--color-muted);
}

/* ==============================
   FOOTER
============================== */
#site-footer {
  background: var(--color-deep);
  color: rgba(255,255,255,0.75);
  padding-block: clamp(3rem, 6vw, 5rem) 0;
}

.footer__widgets {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: clamp(2rem, 4vw, 3rem);
  padding-bottom: clamp(2.5rem, 5vw, 4rem);
  border-bottom: 1px solid rgba(255,255,255,0.1);
}

.footer__widget-title {
  font-family: var(--font-body);
  font-size: var(--size-sm);
  font-weight: 600;
  color: var(--color-white);
  letter-spacing: 0.06em;
  margin-bottom: 1rem;
  padding-bottom: 0.5rem;
  border-bottom: 2px solid var(--color-ocean);
  display: inline-block;
}

.widget ul {
  list-style: none;
  padding: 0;
  margin: 0;
}
.widget ul li {
  margin-bottom: 0.5rem;
}
.widget ul li a {
  color: rgba(255,255,255,0.65);
  font-size: var(--size-sm);
  text-decoration: none;
  transition: color var(--transition);
}
.widget ul li a:hover {
  color: var(--color-sky);
  text-decoration: none;
}

.widget p {
  font-size: var(--size-sm);
  color: rgba(255,255,255,0.65);
  max-width: 36ch;
}

.footer__bottom {
  padding-block: 1.25rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  font-size: var(--size-xs);
  flex-wrap: wrap;
}

.footer__copyright {
  color: rgba(255,255,255,0.45);
}

.footer__credits {
  color: rgba(255,255,255,0.35);
}
.footer__credits a {
  color: rgba(255,255,255,0.5);
}
.footer__credits a:hover {
  color: var(--color-sky);
  text-decoration: none;
}

/* ==============================
   BREADCRUMBS
============================== */
.breadcrumbs {
  padding-block: 0.75rem;
  border-bottom: 1px solid var(--color-border);
  font-size: var(--size-xs);
  color: var(--color-muted);
}
.breadcrumbs a {
  color: var(--color-ocean);
}
.breadcrumbs .sep {
  margin-inline: 0.4rem;
  opacity: 0.5;
}

/* ==============================
   PAGINATION
============================== */
.pagination {
  display: flex;
  gap: 0.5rem;
  justify-content: center;
  flex-wrap: wrap;
  padding-block: 2rem;
}
.pagination .page-numbers {
  display: flex;
  align-items: center;
  justify-content: center;
  min-width: 36px;
  height: 36px;
  padding-inline: 0.5rem;
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  font-size: var(--size-sm);
  color: var(--color-ocean);
  background: var(--color-white);
  transition: background var(--transition), color var(--transition);
  text-decoration: none;
}
.pagination .page-numbers:hover,
.pagination .page-numbers.current {
  background: var(--color-ocean);
  color: var(--color-white);
  border-color: var(--color-ocean);
  text-decoration: none;
}

/* ==============================
   404 / NO RESULTS
============================== */
.error-page {
  text-align: center;
  padding-block: clamp(4rem, 10vw, 8rem);
}
.error-page__code {
  font-family: var(--font-heading);
  font-size: clamp(5rem, 15vw, 10rem);
  color: var(--color-sky);
  line-height: 1;
  margin-bottom: 1rem;
}

/* ==============================
   RESPONSIVE
============================== */
@media (max-width: 768px) {
  :root {
    --header-height: 64px;
  }

  .menu-toggle {
    display: flex;
  }

  #primary-navigation {
    position: absolute;
    top: var(--header-height);
    left: 0;
    right: 0;
    background: var(--color-white);
    border-bottom: 1px solid var(--color-border);
    box-shadow: var(--shadow-md);
    padding: 1rem;
    display: none;
  }

  #primary-navigation.is-open {
    display: block;
  }

  .primary-menu {
    flex-direction: column;
    gap: 0.25rem;
  }

  .primary-menu > li > a {
    padding: 0.6rem 0.75rem;
    font-size: var(--size-base);
  }

  .footer__bottom {
    flex-direction: column;
    align-items: flex-start;
    text-align: left;
  }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    transition-duration: 0.01ms !important;
  }
}
