/*
Theme Name: Stylová Inspirace
Theme URI: https://stylovainspirace.cz
Author: Jája Hrabalová
Author URI: https://stylovainspirace.cz
Description: Editorial block theme pro Stylovou Inspiraci — inspirace pro domov, který má styl. Full-site-editing, Newsreader + Inter, paleta písková/grafit/olivová.
Version: 1.0.0
Requires at least: 6.6
Tested up to: 6.7
Requires PHP: 8.1
License: GNU General Public License v2 or later
License URI: http://www.gnu.org/licenses/gpl-2.0.html
Text Domain: stylovainspirace
Tags: block-theme, full-site-editing, blog, magazine, editorial, one-column, three-columns, custom-colors, custom-menu, featured-images, full-width-template, translation-ready, block-styles, block-patterns
*/

/* =========================================================================
   Stylová Inspirace — editorial block theme
   Everything design-token lives in theme.json. This file is for:
   — @font-face (self-host)
   — micro-interactions theme.json can't express
   — reading flow polish
   ========================================================================= */

/* Reset subset — only where block editor output needs help */
*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  -webkit-text-size-adjust: 100%;
  text-rendering: optimizeLegibility;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

body {
  margin: 0;
}

img,
picture,
video,
svg {
  max-width: 100%;
  height: auto;
  vertical-align: middle;
}

/* =========================================================================
   Focus — WCAG AA visible across all interactive elements
   ========================================================================= */
:where(a, button, input, select, textarea, [tabindex]):focus-visible {
  outline: 2px solid var(--wp--preset--color--accent);
  outline-offset: 3px;
  border-radius: 2px;
}

/* Selection */
::selection {
  background: var(--wp--preset--color--contrast);
  color: var(--wp--preset--color--base);
}

/* =========================================================================
   Transitions — subtle, 200ms ease, never on layout
   ========================================================================= */
a,
.wp-block-button__link,
.wp-block-navigation__submenu-container,
.wp-block-image img {
  transition: color 200ms ease, background-color 200ms ease,
    border-color 200ms ease, opacity 200ms ease, transform 320ms ease;
}

/* =========================================================================
   Editorial typography rhythm
   ========================================================================= */
.entry-content p {
  hyphens: auto;
  -webkit-hyphens: auto;
}

.entry-content > *:first-child {
  margin-top: 0;
}

.entry-content p + p {
  margin-top: 1.15em;
}

.entry-content h2,
.entry-content h3 {
  margin-top: 2.25em;
}

.entry-content h2 + h3,
.entry-content h2 + p,
.entry-content h3 + p {
  margin-top: 0.75em;
}

/* Lead paragraph — first <p> after a block separator or as perex */
.is-style-lead,
.has-drop-cap:not(:focus)::first-letter,
.wp-block-post-content > p.is-style-lead:first-of-type {
  font-family: var(--wp--preset--font-family--newsreader);
  font-style: italic;
}

.is-style-lead {
  font-size: var(--wp--preset--font-size--large);
  line-height: 1.6;
  color: var(--wp--preset--color--contrast);
  margin-bottom: 2rem;
}

/* Drop cap tuning for Newsreader */
.has-drop-cap:not(:focus):first-letter {
  font-family: var(--wp--preset--font-family--newsreader);
  font-weight: 560;
  font-size: 5.5em;
  line-height: 0.85;
  margin: 0.12em 0.08em 0 0;
  color: var(--wp--preset--color--contrast);
}

/* =========================================================================
   Links — subtle underline offset, editorial feel
   ========================================================================= */
.entry-content a,
.wp-block-post-content a {
  text-decoration-thickness: 1px;
  text-underline-offset: 0.22em;
}

/* =========================================================================
   Images — lazy hints, figcaption, block aesthetics
   ========================================================================= */
.wp-block-image img {
  display: block;
}

.wp-block-image figcaption {
  margin-top: 0.75rem;
  font-size: var(--wp--preset--font-size--x-small);
  color: var(--wp--preset--color--muted);
  font-style: italic;
  line-height: 1.5;
}

.wp-block-image.is-style-editorial-frame img {
  border: 1px solid var(--wp--preset--color--line);
}

/* =========================================================================
   Separators — hairline, editorial
   ========================================================================= */
.wp-block-separator {
  border: none;
  border-top: 1px solid var(--wp--preset--color--line);
  margin-block: 2.5rem;
  max-width: 80px;
}

.wp-block-separator.is-style-wide {
  max-width: 100%;
}

.wp-block-separator.is-style-dots {
  border-top: none;
  text-align: center;
  max-width: 100%;
}

.wp-block-separator.is-style-dots::before {
  content: "· · ·";
  color: var(--wp--preset--color--muted);
  letter-spacing: 0.6em;
  font-size: 1.25rem;
}

/* =========================================================================
   Navigation — editorial restraint
   ========================================================================= */
.wp-block-navigation .wp-block-navigation-item__content {
  padding-block: 0.25rem;
}

.wp-block-navigation .wp-block-navigation-item:hover > a {
  color: var(--wp--preset--color--accent);
}

.wp-block-navigation .current-menu-item > a,
.wp-block-navigation .current_page_item > a {
  color: var(--wp--preset--color--accent);
  font-weight: 600;
}

/* Hamburger mobile nav — editorial overlay */
.wp-block-navigation__responsive-container.is-menu-open {
  padding-top: 4rem;
  background: var(--wp--preset--color--base);
}

.wp-block-navigation__responsive-container.is-menu-open
  .wp-block-navigation-item a {
  font-family: var(--wp--preset--font-family--newsreader);
  font-size: var(--wp--preset--font-size--x-large);
}

/* =========================================================================
   Post hero — single.html
   ========================================================================= */
.stylova-hero {
  position: relative;
  padding-block: 4rem 3rem;
}

.stylova-hero .stylova-hero__kicker {
  font-family: var(--wp--preset--font-family--inter);
  font-size: var(--wp--preset--font-size--x-small);
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--wp--preset--color--muted);
  margin-bottom: 1.25rem;
}

/* =========================================================================
   Post meta — byline strip
   ========================================================================= */
.stylova-post-meta {
  font-family: var(--wp--preset--font-family--inter);
  font-size: var(--wp--preset--font-size--x-small);
  letter-spacing: 0.04em;
  color: var(--wp--preset--color--muted);
  border-top: 1px solid var(--wp--preset--color--line);
  border-bottom: 1px solid var(--wp--preset--color--line);
  padding-block: 0.9rem;
  margin-block: 2rem;
}

.stylova-post-meta a {
  color: inherit;
  text-decoration: none;
}

.stylova-post-meta a:hover {
  color: var(--wp--preset--color--accent);
}

/* =========================================================================
   Hero post — magazine lead (home.html)
   ========================================================================= */
.stylova-hero-post__layout {
  margin-bottom: 0;
}

.stylova-hero-post__image .wp-block-post-featured-image {
  overflow: hidden;
  margin: 0;
}

.stylova-hero-post__image img {
  width: 100%;
  aspect-ratio: 3 / 2;
  object-fit: cover;
  transition: transform 600ms cubic-bezier(0.16, 0.84, 0.44, 1);
}

.stylova-hero-post:hover .stylova-hero-post__image img {
  transform: scale(1.025);
}

.stylova-hero-post__text {
  padding: 0 0.5rem;
}

.stylova-hero-post__text .wp-block-post-terms {
  margin-bottom: 0.5rem;
}

.stylova-hero-post__text .wp-block-post-title a {
  text-decoration: none;
  color: var(--wp--preset--color--contrast);
}

.stylova-hero-post__text .wp-block-post-title a:hover {
  color: var(--wp--preset--color--accent);
}

.stylova-hero-post__text .wp-block-post-excerpt {
  font-family: var(--wp--preset--font-family--inter);
  color: var(--wp--preset--color--contrast);
}

.stylova-hero-post__text .wp-block-post-excerpt__more-link {
  display: inline-block;
  margin-top: 1rem;
  font-family: var(--wp--preset--font-family--inter);
  font-size: 0.8125rem;
  font-weight: 600;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  text-decoration: none;
  color: var(--wp--preset--color--contrast);
  border-bottom: 1px solid var(--wp--preset--color--contrast);
  padding-bottom: 2px;
}

.stylova-hero-post__text .wp-block-post-excerpt__more-link:hover {
  color: var(--wp--preset--color--accent);
  border-bottom-color: var(--wp--preset--color--accent);
}

/* Mobile — stack image above text */
@media (max-width: 781px) {
  .stylova-hero-post__layout.wp-block-columns {
    flex-direction: column !important;
    gap: 1.5rem !important;
  }
  .stylova-hero-post__image,
  .stylova-hero-post__text {
    flex-basis: 100% !important;
    width: 100%;
  }
  .stylova-hero-post__text {
    padding: 0;
  }
}

/* =========================================================================
   Featured grid — magazine 3-col (used on home & archives)
   ========================================================================= */
.stylova-featured-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 2.25rem 1.5rem;
}

@media (min-width: 640px) {
  .stylova-featured-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (min-width: 960px) {
  .stylova-featured-grid {
    grid-template-columns: repeat(3, 1fr);
  }
}

.stylova-featured-grid .wp-block-post {
  display: flex;
  flex-direction: column;
}

.stylova-featured-grid .wp-block-post-featured-image {
  margin-bottom: 1rem;
  overflow: hidden;
}

.stylova-featured-grid .wp-block-post-featured-image img {
  aspect-ratio: 3 / 2;
  object-fit: cover;
  width: 100%;
  transition: transform 600ms cubic-bezier(0.16, 0.84, 0.44, 1);
}

.stylova-featured-grid .wp-block-post:hover .wp-block-post-featured-image img {
  transform: scale(1.03);
}

.stylova-featured-grid .wp-block-post-terms {
  margin-bottom: 0.4rem;
}

.stylova-featured-grid .wp-block-post-title {
  font-size: 1.375rem;
  line-height: 1.2;
  letter-spacing: -0.015em;
  margin-block: 0 0.6rem;
}

.stylova-featured-grid .wp-block-post-title a {
  text-decoration: none;
  color: var(--wp--preset--color--contrast);
}

.stylova-featured-grid .wp-block-post-title a:hover {
  color: var(--wp--preset--color--accent);
}

.stylova-featured-grid .wp-block-post-excerpt {
  font-family: var(--wp--preset--font-family--inter);
  font-style: normal;
  font-size: 0.9375rem;
  line-height: 1.55;
  color: var(--wp--preset--color--muted);
  margin-block: 0;
}

.stylova-featured-grid .wp-block-post-excerpt__more-link {
  display: none;
}

/* =========================================================================
   Category eyebrow — small caps above post titles
   ========================================================================= */
.stylova-eyebrow,
.wp-block-post-terms {
  font-family: var(--wp--preset--font-family--inter);
  font-size: var(--wp--preset--font-size--x-small);
  font-weight: 600;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--wp--preset--color--accent);
}

.wp-block-post-terms a {
  text-decoration: none;
  color: inherit;
}

/* =========================================================================
   Archive header — editorial
   ========================================================================= */
.stylova-archive-header {
  text-align: center;
  padding-block: 4rem 2.5rem;
  border-bottom: 1px solid var(--wp--preset--color--line);
  margin-bottom: 3rem;
}

.stylova-archive-header .wp-block-query-title {
  font-family: var(--wp--preset--font-family--newsreader);
  font-size: var(--wp--preset--font-size--display);
  font-weight: 420;
  line-height: 1.05;
  letter-spacing: -0.02em;
}

/* =========================================================================
   Footer — 3col editorial
   ========================================================================= */
.stylova-footer {
  background: var(--wp--preset--color--contrast);
  color: var(--wp--preset--color--base);
  margin-top: 6rem;
  padding-block: 4rem 2rem;
}

.stylova-footer a {
  color: var(--wp--preset--color--base);
  text-decoration: none;
}

.stylova-footer a:hover {
  color: var(--wp--preset--color--accent);
}

.stylova-footer h3,
.stylova-footer h4 {
  color: var(--wp--preset--color--base);
  font-family: var(--wp--preset--font-family--newsreader);
  font-size: 1rem;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  margin-bottom: 1.25rem;
}

.stylova-footer__bottom {
  margin-top: 3rem;
  padding-top: 2rem;
  border-top: 1px solid rgba(245, 239, 230, 0.15);
  font-size: var(--wp--preset--font-size--x-small);
  color: rgba(245, 239, 230, 0.6);
  letter-spacing: 0.04em;
}

/* =========================================================================
   Buttons — hover states already in theme.json, here: width variants
   ========================================================================= */
.wp-block-button.is-style-outline .wp-block-button__link {
  background: transparent;
  border: 1px solid var(--wp--preset--color--contrast);
  color: var(--wp--preset--color--contrast);
}

.wp-block-button.is-style-outline .wp-block-button__link:hover,
.wp-block-button.is-style-outline .wp-block-button__link:focus {
  background: var(--wp--preset--color--contrast);
  color: var(--wp--preset--color--base);
}

/* =========================================================================
   Newsletter CTA — pattern support
   ========================================================================= */
.stylova-newsletter {
  background: var(--wp--preset--color--base-soft);
  padding: 3.5rem 2rem;
  text-align: center;
  border: 1px solid var(--wp--preset--color--line);
}

.stylova-newsletter h2 {
  margin-top: 0;
}

.stylova-newsletter form {
  display: flex;
  gap: 0.75rem;
  max-width: 420px;
  margin: 1.5rem auto 0;
}

.stylova-newsletter input[type="email"] {
  flex: 1;
  padding: 0.85rem 1rem;
  border: 1px solid var(--wp--preset--color--contrast);
  background: var(--wp--preset--color--white);
  font-family: inherit;
  font-size: var(--wp--preset--font-size--small);
}

/* =========================================================================
   Reading comfort — tables, blockquote, code
   ========================================================================= */
table {
  border-collapse: collapse;
  width: 100%;
}

th,
td {
  border-bottom: 1px solid var(--wp--preset--color--line);
  padding: 0.6rem 0.75rem;
  text-align: left;
}

th {
  font-weight: 600;
  color: var(--wp--preset--color--contrast);
}

/* =========================================================================
   Accessibility — skip link and reduced motion
   ========================================================================= */
.skip-link {
  position: absolute;
  left: -9999px;
  top: 1rem;
  z-index: 999;
}

.skip-link:focus {
  left: 1rem;
  background: var(--wp--preset--color--contrast);
  color: var(--wp--preset--color--base);
  padding: 0.75rem 1rem;
  text-decoration: none;
}

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

  .stylova-featured-grid .wp-block-post:hover .wp-block-post-featured-image img {
    transform: none;
  }
}

/* =========================================================================
   Print — readable articles
   ========================================================================= */
@media print {
  .wp-block-navigation,
  .stylova-footer,
  .wp-block-button {
    display: none;
  }

  body {
    background: white;
    color: black;
  }
}
