/*
Theme Name: uganke.si
Theme URI: https://example.com/ugankarski-koticek
Author: Mars media d.o.o.
Description: WordPress tema za uganke, sudoku in druge dnevne miselne izzive.
Version: 1.1.1
Requires at least: 6.0
Tested up to: 6.8
Requires PHP: 7.4
Text Domain: ugankarski-koticek
License: GNU General Public License v2 or later
License URI: https://www.gnu.org/licenses/gpl-2.0.html
Tags: blog, one-column, two-columns, custom-logo, custom-menu, featured-images, threaded-comments, translation-ready
*/

:root {
  --paper: #fffef7;
  --paper-deep: #fff8d9;
  --ink: #292a24;
  --muted: #68695f;
  --line: #e8e3c9;
  --accent: #e5b92f;
  --accent-dark: #705700;
  --white: #ffffff;
  --shadow: 0 12px 35px rgba(76, 68, 25, 0.07);
  --radius: 20px;
  --content: 1160px;
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: ui-rounded, "Nunito", "Arial Rounded MT Bold", system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  font-size: 17px;
  line-height: 1.7;
  -webkit-font-smoothing: antialiased;
}

a { color: var(--accent-dark); text-decoration-thickness: 1.5px; text-underline-offset: 3px; }
a:hover { color: var(--accent); }
img { display: block; max-width: 100%; height: auto; }
button, input, textarea, select { font: inherit; }

.site-shell { min-height: 100vh; display: flex; flex-direction: column; }
.site-main { flex: 1; }
.container { width: min(calc(100% - 40px), var(--content)); margin-inline: auto; }
.narrow { width: min(calc(100% - 40px), 780px); margin-inline: auto; }

.screen-reader-text {
  position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; border: 0;
}
.screen-reader-text:focus {
  z-index: 100000; top: 8px; left: 8px; width: auto; height: auto; margin: 0;
  padding: 10px 14px; clip: auto; background: var(--white); color: var(--ink);
}

.site-header { position: relative; z-index: 20; border-bottom: 1px solid var(--line); background: rgba(255, 254, 247, .96); }
.header-inner { min-height: 78px; display: flex; align-items: center; justify-content: space-between; gap: 28px; }
.site-branding { display: flex; align-items: center; gap: 12px; min-width: 0; }
.custom-logo { width: auto; max-height: 48px; }
.site-title { margin: 0; font-size: clamp(1.15rem, 3vw, 1.45rem); font-weight: 850; letter-spacing: -.03em; }
.site-title a { color: var(--ink); text-decoration: none; }
.site-title a::before { content: "?"; display: inline-grid; width: 34px; height: 34px; margin-right: 9px; place-items: center; border-radius: 50%; background: var(--accent); color: var(--ink); font-size: 1.1rem; transform: rotate(-6deg); }

.primary-menu { display: flex; align-items: center; gap: 24px; margin: 0; padding: 0; list-style: none; }
.primary-menu a { color: var(--ink); font-size: .95rem; font-weight: 750; text-decoration: none; }
.primary-menu a:hover, .primary-menu .current-menu-item > a { color: var(--accent-dark); }
.menu-toggle { display: none; padding: 9px 13px; border: 1px solid var(--line); border-radius: 12px; background: var(--white); color: var(--ink); cursor: pointer; }

.hero { padding: clamp(62px, 10vw, 118px) 0 clamp(52px, 8vw, 92px); border-bottom: 1px solid var(--line); }
.hero-inner { display: grid; grid-template-columns: minmax(0, 1.35fr) minmax(250px, .65fr); align-items: center; gap: clamp(36px, 7vw, 90px); }
.eyebrow { margin: 0 0 12px; color: var(--accent-dark); font-size: .78rem; font-weight: 850; letter-spacing: .14em; text-transform: uppercase; }
.hero h1, .archive-header h1, .entry-title { margin: 0; font-weight: 900; line-height: 1.08; letter-spacing: -.045em; }
.hero h1 { max-width: 760px; font-size: clamp(2.55rem, 7vw, 5.3rem); }
.hero-copy { max-width: 620px; margin: 22px 0 0; color: var(--muted); font-size: clamp(1.05rem, 2vw, 1.22rem); }
.hero-mark { position: relative; aspect-ratio: 1; display: grid; place-items: center; border: 2px solid var(--line); border-radius: 44% 56% 51% 49%; background: var(--paper-deep); transform: rotate(4deg); }
.hero-mark span { color: var(--accent); font-size: clamp(7rem, 15vw, 12rem); font-weight: 900; line-height: 1; transform: rotate(-8deg); }
.hero-mark::after { content: ""; position: absolute; inset: 12%; border: 1px dashed rgba(112, 87, 0, .22); border-radius: 50%; }

.section { padding: clamp(54px, 8vw, 94px) 0; }
.section + .section { border-top: 1px solid var(--line); }
.section-heading { display: flex; align-items: end; justify-content: space-between; gap: 20px; margin-bottom: 30px; }
.section-heading h2 { margin: 0; font-size: clamp(1.8rem, 4vw, 2.8rem); line-height: 1.1; letter-spacing: -.035em; }
.section-heading p { max-width: 480px; margin: 0; color: var(--muted); }

.puzzle-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 22px; }
.puzzle-card { position: relative; display: flex; flex-direction: column; min-height: 320px; overflow: hidden; border: 1px solid var(--line); border-radius: var(--radius); background: var(--white); box-shadow: var(--shadow); transition: transform .2s ease, box-shadow .2s ease; }
.puzzle-card:hover { transform: translateY(-4px); box-shadow: 0 18px 42px rgba(76, 68, 25, .11); }
.puzzle-card__image { aspect-ratio: 16 / 9; overflow: hidden; background: var(--paper-deep); }
.puzzle-card__image img { width: 100%; height: 100%; object-fit: cover; transition: transform .35s ease; }
.puzzle-card:hover .puzzle-card__image img { transform: scale(1.025); }
.puzzle-card__body { display: flex; flex: 1; flex-direction: column; padding: 24px; }
.card-meta { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; margin-bottom: 13px; color: var(--muted); font-size: .76rem; font-weight: 800; letter-spacing: .05em; text-transform: uppercase; }
.category-pill { display: inline-block; padding: 5px 10px; border-radius: 999px; background: var(--paper-deep); color: var(--accent-dark); text-decoration: none; }
.fallback-note { color: var(--muted); }
.puzzle-card h3 { margin: 0 0 11px; font-size: 1.4rem; line-height: 1.22; letter-spacing: -.025em; }
.puzzle-card h3 a { color: var(--ink); text-decoration: none; }
.card-excerpt { margin: 0 0 24px; color: var(--muted); font-family: Georgia, "Times New Roman", serif; line-height: 1.6; }
.card-link { margin-top: auto; color: var(--accent-dark); font-weight: 850; text-decoration: none; }
.card-link::after { content: " →"; }

.category-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 15px; }
.category-card { display: block; padding: 23px; border: 1px solid var(--line); border-radius: 16px; background: transparent; color: var(--ink); text-decoration: none; transition: background .2s ease, border-color .2s ease; }
.category-card:hover { border-color: #d7cc90; background: var(--white); color: var(--ink); }
.category-card__top { display: flex; justify-content: space-between; gap: 12px; align-items: baseline; }
.category-card h3 { margin: 0; font-size: 1.08rem; line-height: 1.3; }
.category-count { color: var(--accent-dark); font-size: .82rem; font-weight: 850; }
.category-card p { margin: 10px 0 0; color: var(--muted); font-family: Georgia, "Times New Roman", serif; font-size: .92rem; line-height: 1.5; }

.archive-header { padding: 64px 0 34px; }
.archive-header h1 { font-size: clamp(2.3rem, 6vw, 4.25rem); }
.archive-description { max-width: 690px; margin-top: 18px; color: var(--muted); font-family: Georgia, "Times New Roman", serif; }
.archive-content { padding-bottom: 80px; }
.archive-content .puzzle-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }

.single-wrap { padding: clamp(48px, 8vw, 84px) 0 90px; }
.single-header { margin-bottom: 34px; text-align: center; }
.single-header .card-meta { justify-content: center; }
.entry-title { font-size: clamp(2.3rem, 6vw, 4.6rem); }
.entry-thumbnail { margin: 0 auto 38px; overflow: hidden; border-radius: var(--radius); box-shadow: var(--shadow); }
.entry-content { padding: clamp(24px, 5vw, 48px); border: 1px solid var(--line); border-radius: var(--radius); background: var(--white); font-family: Georgia, "Times New Roman", serif; font-size: 1.08rem; box-shadow: var(--shadow); }
.entry-content > *:first-child { margin-top: 0; }
.entry-content > *:last-child { margin-bottom: 0; }
.entry-content h2, .entry-content h3 { font-family: ui-rounded, "Arial Rounded MT Bold", system-ui, sans-serif; line-height: 1.25; }
.entry-content a { overflow-wrap: anywhere; }
.entry-content blockquote { margin-inline: 0; padding: 8px 0 8px 24px; border-left: 4px solid var(--accent); color: var(--muted); }
.entry-content table { width: 100%; border-collapse: collapse; }
.entry-content th, .entry-content td { padding: 10px; border: 1px solid var(--line); }
.entry-content iframe, .entry-content canvas, .entry-content .wp-block-embed { max-width: 100%; }
.entry-footer { margin-top: 22px; color: var(--muted); font-size: .9rem; text-align: center; }
.post-navigation { display: grid; grid-template-columns: 1fr 1fr; gap: 18px; margin-top: 30px; }
.post-navigation a { display: block; padding: 18px 20px; border: 1px solid var(--line); border-radius: 14px; background: var(--white); text-decoration: none; }
.nav-next { text-align: right; }

.comments-area { margin-top: 36px; padding-top: 30px; border-top: 1px solid var(--line); }
.comment-list { padding-left: 24px; }
.comment-body { margin-bottom: 22px; padding: 18px; border: 1px solid var(--line); border-radius: 14px; background: var(--white); }
textarea, input[type="text"], input[type="email"], input[type="url"], input[type="search"] { width: 100%; padding: 12px 14px; border: 1px solid var(--line); border-radius: 10px; background: var(--white); color: var(--ink); }
.button, button, input[type="submit"] { padding: 11px 18px; border: 0; border-radius: 999px; background: var(--accent); color: var(--ink); font-weight: 800; cursor: pointer; }
.button:hover, button:hover, input[type="submit"]:hover { background: var(--accent-dark); color: #fff; }

.pagination { margin-top: 38px; }
.nav-links { display: flex; flex-wrap: wrap; gap: 8px; justify-content: center; }
.page-numbers { min-width: 40px; padding: 7px 11px; border: 1px solid var(--line); border-radius: 10px; background: var(--white); text-align: center; text-decoration: none; }
.page-numbers.current { border-color: var(--accent); background: var(--accent); color: var(--ink); }
.empty-state { padding: 42px; border: 1px dashed var(--line); border-radius: var(--radius); text-align: center; }
.ad-area { width: 100%; margin: 28px auto 0; overflow: hidden; text-align: center; }
.ad-slot, .ad-slot > * { max-width: 100%; margin-inline: auto; }

.site-footer { padding: 38px 0; border-top: 1px solid var(--line); }
.footer-inner { display: flex; justify-content: space-between; gap: 20px; align-items: center; color: var(--muted); font-size: .9rem; }
.footer-inner p { margin: 0; }
.footer-menu { display: flex; flex-wrap: wrap; gap: 16px; margin: 0; padding: 0; list-style: none; }
.footer-menu a { color: var(--muted); text-decoration: none; }

@media (max-width: 900px) {
  .puzzle-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .category-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .hero-inner { grid-template-columns: 1fr; }
  .hero-mark { width: min(270px, 66vw); justify-self: center; }
  .menu-toggle { display: block; }
  .site-nav { position: absolute; top: 78px; right: 20px; left: 20px; display: none; padding: 18px; border: 1px solid var(--line); border-radius: 16px; background: var(--white); box-shadow: var(--shadow); }
  .site-nav.is-open { display: block; }
  .primary-menu { flex-direction: column; align-items: stretch; gap: 6px; }
  .primary-menu a { display: block; padding: 8px; }
}

@media (max-width: 620px) {
  .container, .narrow { width: min(calc(100% - 28px), var(--content)); }
  .header-inner { min-height: 54px; gap: 10px; }
  .custom-logo { max-height: 36px; }
  .site-title { font-size: 1rem; }
  .site-title a::before { width: 27px; height: 27px; margin-right: 6px; font-size: .9rem; }
  .menu-toggle { padding: 6px 10px; font-size: .86rem; }
  .site-nav { top: 58px; right: 10px; left: 10px; max-height: calc(100vh - 68px); overflow-y: auto; padding: 10px; }
  .primary-menu a { padding: 6px 8px; }
  .puzzle-grid, .archive-content .puzzle-grid, .category-grid { grid-template-columns: 1fr; }
  .section-heading, .footer-inner { align-items: flex-start; flex-direction: column; }
  .post-navigation { grid-template-columns: 1fr; }
  .nav-next { text-align: left; }
  .hero { padding: 38px 0 34px; }
  .hero-inner { gap: 0; }
  .hero h1 { font-size: clamp(2.2rem, 12vw, 3.1rem); }
  .hero-copy { margin-top: 15px; font-size: 1rem; }
  .hero-mark { display: none; }
  .section { padding: 38px 0; }
  .section-heading { gap: 8px; margin-bottom: 20px; }
  .puzzle-card { min-height: 0; }
  .puzzle-card__body { padding: 19px; }
  .single-wrap { padding: 28px 0 48px; }
  .single-header { margin-bottom: 20px; }
  .entry-title { font-size: clamp(2rem, 10vw, 3rem); }
  .entry-thumbnail { margin-bottom: 18px; border-radius: 12px; }
  .entry-content { padding: 18px 14px; border-right: 0; border-left: 0; border-radius: 0; font-size: 1rem; box-shadow: none; }
  .single-wrap article.narrow { width: 100%; }
  .single-wrap article.narrow > .single-header,
  .single-wrap article.narrow > .entry-thumbnail,
  .single-wrap article.narrow > .entry-footer,
  .single-wrap article.narrow > .ad-area { width: calc(100% - 28px); margin-right: auto; margin-left: auto; }
  .archive-header { padding: 38px 0 24px; }
  .archive-content { padding-bottom: 48px; }
  .site-footer { padding: 24px 0; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { transition-duration: .01ms !important; animation-duration: .01ms !important; animation-iteration-count: 1 !important; }
}
