/*
Theme Name:   Klub Rysov
Theme URI:    https://klubrysov.sk
Description:  Child theme built on Kadence — "Pearl Blue" color palette, Fraunces + Inter typography.
Author:       Klub chovateľov holubov Rysov
Author URI:   https://klubrysov.sk
Template:     kadence
Version:      0.2.0
Requires at least: 6.0
Tested up to: 6.7
Requires PHP: 8.0
License:      GPL-2.0-or-later
License URI:  https://www.gnu.org/licenses/gpl-2.0.html
Text Domain:  klub-rysov
*/

/* ============================================================
   Klub Rysov — "Pearl Blue" variant
   These tokens override Kadence's globals. The full visual
   system lives in /docs/DESIGN.md.
   ============================================================ */

:root {
  --kr-bg:           #fbfaf6;
  --kr-surface:      #ffffff;
  --kr-primary:      #1e3a5f;
  --kr-primary-dark: #142840;
  --kr-accent:       #c4a572;
  --kr-text:         #1c1f24;
  --kr-text-muted:   #5a6068;
  --kr-border:       #e7e3d8;
  --kr-sidebar-bg:   #f3f0e8;
  --kr-hero-overlay: rgba(20, 40, 64, 0.55);
}

/* ----- Typography ----- */
body,
.site-content,
.content-area {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  font-size: 16px;
  line-height: 1.65;
  color: var(--kr-text);
  -webkit-font-smoothing: antialiased;
}

h1, h2, h3, h4, h5, h6,
.entry-title,
.site-title {
  font-family: 'Fraunces', Georgia, serif;
  font-weight: 600;
  line-height: 1.2;
  letter-spacing: -0.01em;
}

/* ----- Header / navigation ----- */
.site-header { background: var(--kr-surface); border-bottom: 1px solid var(--kr-border); }
.site-branding .site-title a { color: var(--kr-text); }
.main-navigation a {
  color: var(--kr-text);
  font-weight: 500;
  border-bottom: 2px solid transparent;
  transition: border-color .2s, color .2s;
}
.main-navigation a:hover,
.main-navigation .current-menu-item > a {
  color: var(--kr-primary);
  border-bottom-color: var(--kr-accent);
}

/* ----- Buttons ----- */
.wp-block-button__link,
.kadence-button,
button.btn,
input[type="submit"] {
  background: var(--kr-accent);
  color: var(--kr-primary-dark);
  font-weight: 600;
  border-radius: 6px;
  border: none;
  padding: 12px 24px;
  transition: transform .2s;
}
.wp-block-button__link:hover,
.kadence-button:hover {
  transform: translateY(-2px);
  background: var(--kr-accent);
  color: var(--kr-primary-dark);
}

/* ----- Cards / articles ----- */
.article-card,
.kadence-blocks-post-grid .loop-entry {
  background: var(--kr-surface);
  border: 1px solid var(--kr-border);
  border-radius: 12px;
  transition: transform .3s, box-shadow .3s;
}
.article-card:hover,
.kadence-blocks-post-grid .loop-entry:hover {
  transform: translateY(-4px);
  box-shadow: 0 16px 40px rgba(0,0,0,0.08);
}

/* ----- Sidebar (interior pages) ----- */
.widget-area .widget {
  background: var(--kr-sidebar-bg);
  border-radius: 12px;
  padding: 22px;
  margin-bottom: 18px;
}
.widget-area .widget-title {
  font-family: 'Inter', sans-serif;
  font-size: 12px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: .1em;
  color: var(--kr-primary);
  margin-bottom: 14px;
}
.widget-area ul { list-style: none; padding: 0; }
.widget-area li a {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 8px 12px;
  font-size: 14px;
  color: var(--kr-text);
  border-radius: 6px;
  font-weight: 500;
}
.widget-area li a:hover { background: rgba(255,255,255,.6); }
.widget-area li.current-cat > a,
.widget-area li.current-menu-item > a {
  background: var(--kr-primary);
  color: #fff;
}

/* ----- Page background -----
   One flat surface from top to bottom; the only colour is the gradient the
   header band starts with, the way the old site opened. Kadence paints the
   body, the content and the hero separately, hence the `body` prefixes — its
   own CSS is inline and would otherwise win. */
html body {
  background-color: #fff;
}
body .content-bg,
body.content-style-unboxed .site,
body .site-footer,
body .site-footer-wrap,
body .site-top-footer-wrap,
body .site-middle-footer-wrap,
body .site-bottom-footer-wrap {
  background: transparent;
}
body .entry-hero-container-inner {
  background: linear-gradient(180deg, rgba(30, 58, 95, .22), rgba(30, 58, 95, 0));
}
/* The band is as tall as the pigeon in it — Kadence's own 200px reservation
   for the page title is what made every page start so low. */
body .entry-hero .entry-header {
  min-height: 0;
}
body.kr-has-bird .entry-hero .entry-header {
  min-height: calc(var(--kr-bird-h) + 16px);
}

/* Kadence floats the article on a card; on one flat surface it has nothing to
   float above. */
body .content-bg,
body .entry.content-bg {
  box-shadow: none;
}
body .content-area,
body .site-content {
  background: transparent;
}

/* ----- Footer ----- */
.site-footer {
  color: var(--kr-text-muted);
  border-top: 1px solid var(--kr-border);
}
.site-footer a { color: var(--kr-text-muted); }
.site-footer a:hover { color: var(--kr-primary); }
.site-footer .widget-title { color: var(--kr-primary); }

/* ----- Breadcrumbs ----- */
.kadence-breadcrumbs,
.breadcrumbs {
  font-size: 13px;
  color: var(--kr-text-muted);
}
.breadcrumbs a { color: var(--kr-text-muted); }
.breadcrumbs a:hover { color: var(--kr-primary); }

/* ----- Gallery overrides ----- */
.wp-block-gallery .wp-block-image figcaption {
  background: linear-gradient(180deg, transparent 60%, rgba(0,0,0,0.6));
  color: #fff;
}

/* ----- Side navigation on wide screens -----
   Kadence ships two headers and swaps them at 1025px: #main-header above,
   #mobile-header (hamburger + drawer) below. Only the desktop one is
   re-laid-out here: from 1025px up (Kadence's own switch point) it becomes a
   fixed column on the left; below it the mobile bar + hamburger takes over. */
@media (min-width: 1025px) {
  :root { --kr-nav-width: 260px; }

  body { padding-left: var(--kr-nav-width); }

  #main-header {
    position: fixed;
    top: 0;
    bottom: 0;
    left: 0;
    width: var(--kr-nav-width);
    overflow-y: auto;
    background: var(--kr-surface);
    border-right: 1px solid var(--kr-border);
    z-index: 100;
  }
  .admin-bar #main-header { top: 32px; }

  #main-header .site-container {
    max-width: none;
    padding: 28px 20px;
  }

  /* stop the horizontal header row layout */
  #main-header .site-header-row,
  #main-header .site-header-section,
  #main-header .site-header-item {
    display: block;
    width: 100%;
  }

  #main-header .site-branding { margin: 0 0 28px; }
  #main-header .site-title { font-size: 21px; line-height: 1.3; }

  #main-header .header-navigation ul.menu {
    display: flex;
    flex-direction: column;
    align-items: stretch;
    gap: 2px;
  }
  #main-header .header-navigation ul.menu > li { width: 100%; }
  #main-header .header-navigation ul.menu > li > a {
    display: block;
    width: 100%;
    padding: 9px 12px;
    border-radius: 6px;
    line-height: 1.35;
  }
  #main-header .header-navigation ul.menu > li > a:hover,
  #main-header .header-navigation ul.menu > li.current-menu-item > a {
    background: var(--kr-sidebar-bg);
    color: var(--kr-primary);
  }

  /* submenus open beside the column, not underneath it */
  #main-header .header-navigation ul.sub-menu {
    top: 0;
    left: 100%;
  }
}

/* Kadence hides the site title in the mobile header by default (it expects a
   logo). The club has no logo, so the name is all we have — show it. */
#mobile-header .site-title {
  display: block;
  font-size: 15px;
  line-height: 1.25;
  max-width: 15em;
}

/* ----- Album index ([klub_galeria]) ----- */
.kr-albums {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(230px, 1fr));
  gap: 24px;
}
.kr-album a {
  display: block;
  color: inherit;
  text-decoration: none;
}
.kr-album img {
  display: block;
  width: 100%;
  aspect-ratio: 4 / 3;
  object-fit: cover;
  border-radius: 6px;
  border: 1px solid var(--kr-border);
  transition: transform .2s ease, box-shadow .2s ease;
}
.kr-album a:hover img {
  transform: translateY(-2px);
  box-shadow: 0 6px 18px rgba(20, 40, 64, .18);
}
.kr-album-title {
  display: block;
  margin-top: 10px;
  font-family: 'Fraunces', Georgia, serif;
  font-size: 17px;
  line-height: 1.3;
  color: var(--kr-primary);
}
.kr-album-meta {
  display: block;
  margin-top: 2px;
  font-size: 13px;
  color: var(--kr-text-muted);
}

/* ----- Album page: back link and lightbox caption ----- */
.kr-back {
  margin: 0 0 18px;
  font-size: 14px;
}
.kr-back a {
  color: var(--kr-text-muted);
  text-decoration: none;
}
.kr-back a:hover {
  color: var(--kr-primary);
}
.kr-lightbox-caption {
  position: fixed;
  left: 50%;
  bottom: 24px;
  transform: translateX(-50%);
  max-width: min(90vw, 900px);
  margin: 0;
  padding: 10px 16px;
  border-radius: 6px;
  background: rgba(0, 0, 0, .65);
  color: #fff;
  font-size: 14px;
  line-height: 1.4;
  text-align: center;
  z-index: 100000;
}

/* ----- Club logo instead of the site name ----- */
.site-branding .brand {
  display: flex;
  align-items: center;
  gap: 10px;
}
.site-branding .brand::before {
  content: '';
  flex: none;
  display: block;
  width: 104px;
  height: 83px;
  background: url('assets/logo.png') center / contain no-repeat;
}
/* The name stays for screen readers and search engines, just not on screen. */
.site-branding .site-title {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip-path: inset(50%);
  white-space: nowrap;
}

@media (min-width: 1025px) {
  /* In the side column the logo sits on its own, centred above the menu. */
  #main-header .site-branding .brand {
    justify-content: center;
  }
  #main-header .site-branding .brand::before {
    width: 150px;
    height: 120px;
  }
}

@media (max-width: 1024px) {
  #mobile-header .site-branding .brand::before {
    width: 52px;
    height: 42px;
  }
  /* The mobile bar is short; the logo says it well enough on its own. */
  #mobile-header .site-title {
    display: none;
  }
}

/* ----- A club pigeon in the page header -----
   One variable drives both the picture and the height of the band. */
.kr-has-bird {
  --kr-bird-h: 106px;
}
@media (max-width: 1024px) {
  .kr-has-bird { --kr-bird-h: 76px; }
}
@media (max-width: 600px) {
  .kr-has-bird { --kr-bird-h: 50px; }
}

.kr-has-bird .entry-hero-container-inner {
  position: relative;
  overflow: hidden;
}
.kr-has-bird .entry-hero-container-inner::after {
  content: '';
  position: absolute;
  right: 24px;
  bottom: 8px;
  /* the pigeons share a 520x400 canvas */
  height: var(--kr-bird-h);
  width: calc(var(--kr-bird-h) * 1.3);
  background: var(--kr-bird, none) right bottom / contain no-repeat;
  pointer-events: none;
}
@media (max-width: 600px) {
  /* Keep a long page title from running under the pigeon. */
  .kr-has-bird .entry-hero .entry-header {
    padding-right: calc(var(--kr-bird-h) * 1.3 + 12px);
  }
}

/* ----- Album index ([klub_galeria]) ----- */
.kr-albums {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(230px, 1fr));
  gap: 24px;
}
.kr-album a {
  display: block;
  color: inherit;
  text-decoration: none;
}
.kr-album img {
  display: block;
  width: 100%;
  aspect-ratio: 4 / 3;
  object-fit: cover;
  border-radius: 6px;
  border: 1px solid var(--kr-border);
  transition: transform .2s ease, box-shadow .2s ease;
}
.kr-album a:hover img {
  transform: translateY(-2px);
  box-shadow: 0 6px 18px rgba(20, 40, 64, .18);
}
.kr-album-title {
  display: block;
  margin-top: 10px;
  font-family: 'Fraunces', Georgia, serif;
  font-size: 17px;
  line-height: 1.3;
  color: var(--kr-primary);
}
.kr-album-meta {
  display: block;
  margin-top: 2px;
  font-size: 13px;
  color: var(--kr-text-muted);
}

/* ----- Album page: back link and lightbox caption ----- */
.kr-back {
  margin: 0 0 18px;
  font-size: 14px;
}
.kr-back a {
  color: var(--kr-text-muted);
  text-decoration: none;
}
.kr-back a:hover {
  color: var(--kr-primary);
}
.kr-lightbox-caption {
  position: fixed;
  left: 50%;
  bottom: 24px;
  transform: translateX(-50%);
  max-width: min(90vw, 900px);
  margin: 0;
  padding: 10px 16px;
  border-radius: 6px;
  background: rgba(0, 0, 0, .65);
  color: #fff;
  font-size: 14px;
  line-height: 1.4;
  text-align: center;
  z-index: 100000;
}

/* ----- Club logo instead of the site name ----- */
.site-branding .brand {
  display: flex;
  align-items: center;
  gap: 10px;
}
.site-branding .brand::before {
  content: '';
  flex: none;
  display: block;
  width: 104px;
  height: 83px;
  background: url('assets/logo.png') center / contain no-repeat;
}
/* The name stays for screen readers and search engines, just not on screen. */
.site-branding .site-title {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip-path: inset(50%);
  white-space: nowrap;
}

@media (min-width: 1025px) {
  /* In the side column the logo sits on its own, centred above the menu. */
  #main-header .site-branding .brand {
    justify-content: center;
  }
  #main-header .site-branding .brand::before {
    width: 150px;
    height: 120px;
  }
}

@media (max-width: 1024px) {
  #mobile-header .site-branding .brand::before {
    width: 52px;
    height: 42px;
  }
  /* The mobile bar is short; the logo says it well enough on its own. */
  #mobile-header .site-title {
    display: none;
  }
}
