/*
Theme Name: Häkkisten Sukuseura
Theme URI: https://example.com/hakkisten-sukuseura
Author: Häkkisten Sukuseura ry
Author URI: https://example.com
Description: WordPress-teema Häkkisten Sukuseura ry:lle. Teema käyttää vaakunaa logona ja mosaiikkikuvaa sivuston yläkuvana.
Version: 1.0.0
Requires at least: 6.0
Tested up to: 6.7
Requires PHP: 7.4
License: GNU General Public License v2 or later
License URI: https://www.gnu.org/licenses/gpl-2.0.html
Text Domain: hakkisten-sukuseura
Tags: custom-logo, custom-header, one-column, two-columns, accessibility-ready, blog, featured-images, block-styles
*/

:root {
  --hs-black: #171414;
  --hs-ink: #262323;
  --hs-gold: #fff200;
  --hs-gold-soft: #fff7a8;
  --hs-paper: #fffdf2;
  --hs-mist: #f6f3ea;
  --hs-line: rgba(23, 20, 20, 0.14);
  --hs-shadow: 0 22px 45px rgba(23, 20, 20, 0.16);
  --hs-radius: 22px;
  --hs-content: 1120px;
  --hs-readable: 760px;
  --hs-font: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  --hs-serif: Georgia, "Times New Roman", serif;
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  margin: 0;
  color: var(--hs-ink);
  background: linear-gradient(180deg, #ffffff 0%, var(--hs-paper) 56%, #ffffff 100%);
  font-family: var(--hs-font);
  font-size: 18px;
  line-height: 1.7;
}

img { max-width: 100%; height: auto; }

a {
  color: #111111;
  text-decoration-thickness: 0.08em;
  text-underline-offset: 0.18em;
}

a:hover, a:focus { color: #6b6100; }

.screen-reader-text,
.skip-link:not(:focus) {
  position: absolute !important;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.skip-link:focus {
  position: fixed;
  top: 12px;
  left: 12px;
  z-index: 99999;
  padding: 0.75rem 1rem;
  color: #000;
  background: var(--hs-gold);
  border-radius: 999px;
  box-shadow: var(--hs-shadow);
}

.site-wrap { min-height: 100vh; display: flex; flex-direction: column; }
.site-main { flex: 1; }

.site-header {
  background: var(--hs-black);
  color: #fff;
  border-bottom: 6px solid var(--hs-gold);
}

.hero {
  position: relative;
  min-height: 350px;
  display: grid;
  align-items: end;
  overflow: hidden;
  background-color: var(--hs-black);
  background-image: linear-gradient(180deg, rgba(0,0,0,0.15) 0%, rgba(0,0,0,0.42) 45%, rgba(0,0,0,0.82) 100%), var(--hs-header-image);
  background-position: center top;
  background-repeat: repeat-x;
  background-size: auto 210px;
}

.hero::after {
  content: "";
  position: absolute;
  inset: 170px 0 0;
  background:
    radial-gradient(circle at 20% 30%, rgba(255, 242, 0, 0.2), transparent 28%),
    linear-gradient(180deg, rgba(23,20,20,0) 0%, var(--hs-black) 72%);
  pointer-events: none;
}

.header-inner {
  position: relative;
  z-index: 1;
  width: min(var(--hs-content), calc(100% - 2rem));
  margin: 0 auto;
  padding: 2.4rem 0 2rem;
  display: grid;
  grid-template-columns: 145px minmax(0, 1fr);
  gap: 1.4rem;
  align-items: end;
}

.site-logo-link {
  display: block;
  width: 145px;
  aspect-ratio: 1;
  padding: 0.5rem;
  background: rgba(255,255,255,0.96);
  border: 4px solid var(--hs-gold);
  border-radius: 28px;
  box-shadow: 0 16px 34px rgba(0, 0, 0, 0.38);
}

.site-logo-link img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: contain;
  border-radius: 18px;
}

.site-branding { max-width: 850px; }

.site-title {
  margin: 0;
  font-family: var(--hs-serif);
  font-size: clamp(2.3rem, 7vw, 5rem);
  line-height: 0.95;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  text-wrap: balance;
}

.site-title a { color: #fff; text-decoration: none; }
.site-title a:hover, .site-title a:focus { color: var(--hs-gold-soft); }

.site-description {
  max-width: 700px;
  margin: 0.85rem 0 0;
  color: rgba(255,255,255,0.88);
  font-size: clamp(1rem, 2.3vw, 1.25rem);
}

.primary-navigation {
  background: #ffffff;
  color: var(--hs-ink);
  box-shadow: 0 10px 22px rgba(23, 20, 20, 0.08);
}

.nav-inner {
  width: min(var(--hs-content), calc(100% - 2rem));
  margin: 0 auto;
}

.primary-menu,
.primary-menu ul {
  margin: 0;
  padding: 0;
  list-style: none;
}

.primary-menu {
  display: flex;
  flex-wrap: wrap;
  gap: 0.25rem;
}

.primary-menu a {
  display: block;
  padding: 1rem 1.05rem;
  color: var(--hs-ink);
  font-weight: 750;
  text-decoration: none;
  border-bottom: 4px solid transparent;
}

.primary-menu a:hover,
.primary-menu a:focus,
.primary-menu .current-menu-item > a,
.primary-menu .current_page_item > a {
  color: #000;
  background: var(--hs-mist);
  border-bottom-color: var(--hs-gold);
}

.primary-menu .sub-menu {
  min-width: 220px;
  background: #fff;
  border: 1px solid var(--hs-line);
  box-shadow: var(--hs-shadow);
}

.primary-menu .menu-item-has-children { position: relative; }
.primary-menu .sub-menu { display: none; position: absolute; z-index: 20; }
.primary-menu .menu-item-has-children:hover > .sub-menu,
.primary-menu .menu-item-has-children:focus-within > .sub-menu { display: block; }
.primary-menu .sub-menu a { padding: 0.75rem 1rem; border-bottom: 0; }

.no-menu {
  margin: 0;
  padding: 1rem 0;
  color: #595555;
}

.container {
  width: min(var(--hs-content), calc(100% - 2rem));
  margin: 0 auto;
}

.content-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 320px;
  gap: 2rem;
  padding: clamp(2rem, 5vw, 4rem) 0;
}

.content-layout.no-sidebar { grid-template-columns: minmax(0, 1fr); }

.article-card,
.widget,
.comment-respond,
.comments-area {
  background: #fff;
  border: 1px solid var(--hs-line);
  border-radius: var(--hs-radius);
  box-shadow: 0 12px 28px rgba(23, 20, 20, 0.08);
}

.article-card {
  margin-bottom: 2rem;
  overflow: hidden;
}

.article-inner { padding: clamp(1.4rem, 4vw, 2.4rem); }

.entry-header { margin-bottom: 1.15rem; }

.entry-title {
  margin: 0 0 0.5rem;
  font-family: var(--hs-serif);
  font-size: clamp(2rem, 4vw, 3.3rem);
  line-height: 1.08;
  color: var(--hs-black);
  text-wrap: balance;
}

.entry-title a { text-decoration: none; }
.entry-title a:hover, .entry-title a:focus { color: #6b6100; }

.entry-meta,
.entry-footer,
.comment-metadata {
  color: #6a6464;
  font-size: 0.95rem;
}

.entry-meta a,
.entry-footer a { color: #554f00; }

.post-thumbnail img {
  display: block;
  width: 100%;
  max-height: 520px;
  object-fit: cover;
}

.entry-content > *:first-child { margin-top: 0; }
.entry-content > *:last-child { margin-bottom: 0; }
.entry-content p { margin: 0 0 1.15rem; }
.entry-content h2, .entry-content h3, .entry-content h4 {
  margin: 2rem 0 0.8rem;
  line-height: 1.2;
  color: var(--hs-black);
}

.entry-content h2 { font-size: clamp(1.6rem, 3vw, 2.2rem); }
.entry-content h3 { font-size: clamp(1.35rem, 2.5vw, 1.7rem); }

.entry-content blockquote {
  margin: 1.6rem 0;
  padding: 1rem 1.2rem;
  border-left: 6px solid var(--hs-gold);
  background: var(--hs-mist);
  border-radius: 0 18px 18px 0;
}

.entry-content table {
  width: 100%;
  border-collapse: collapse;
  margin: 1.5rem 0;
  font-size: 0.96rem;
}

.entry-content th,
.entry-content td {
  padding: 0.75rem;
  border: 1px solid var(--hs-line);
  text-align: left;
}

.entry-content th { background: var(--hs-mist); }

.wp-block-button__link,
.button,
button,
input[type="submit"] {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 44px;
  padding: 0.75rem 1.1rem;
  color: #000;
  background: var(--hs-gold);
  border: 0;
  border-radius: 999px;
  font-weight: 800;
  text-decoration: none;
  cursor: pointer;
}

.wp-block-button__link:hover,
.button:hover,
button:hover,
input[type="submit"]:hover { filter: brightness(0.96); }

input[type="text"],
input[type="email"],
input[type="url"],
input[type="search"],
textarea {
  width: 100%;
  padding: 0.8rem 0.9rem;
  border: 1px solid var(--hs-line);
  border-radius: 14px;
  font: inherit;
  background: #fff;
}

.sidebar { display: grid; gap: 1.2rem; align-content: start; }
.widget { padding: 1.25rem; }
.widget-title, .widget h2, .widget h3 {
  margin: 0 0 0.7rem;
  font-size: 1.15rem;
  font-weight: 850;
  letter-spacing: 0.02em;
}
.widget ul { padding-left: 1.15rem; margin: 0; }

.page-header {
  margin-bottom: 1.5rem;
  padding: 1.5rem;
  background: var(--hs-mist);
  border-radius: var(--hs-radius);
  border: 1px solid var(--hs-line);
}
.page-title { margin: 0; font-family: var(--hs-serif); font-size: clamp(2rem, 4vw, 3rem); }
.archive-description { margin-top: 0.5rem; }

.pagination,
.post-navigation,
.posts-navigation {
  margin: 2rem 0;
}
.nav-links {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  align-items: center;
  justify-content: space-between;
}
.nav-links a,
.page-numbers {
  display: inline-flex;
  padding: 0.55rem 0.85rem;
  border: 1px solid var(--hs-line);
  border-radius: 999px;
  background: #fff;
  text-decoration: none;
}
.page-numbers.current { background: var(--hs-black); color: #fff; }

.comments-area { padding: clamp(1.4rem, 4vw, 2.4rem); margin-top: 2rem; }
.comment-list { padding: 0; list-style: none; }
.comment { margin: 1rem 0; padding: 1rem; border: 1px solid var(--hs-line); border-radius: 18px; }

.site-footer {
  margin-top: auto;
  color: rgba(255,255,255,0.84);
  background: var(--hs-black);
  border-top: 6px solid var(--hs-gold);
}

.footer-inner {
  width: min(var(--hs-content), calc(100% - 2rem));
  margin: 0 auto;
  padding: 2rem 0;
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 1rem;
  align-items: center;
}

.footer-brand { display: flex; align-items: center; gap: 0.8rem; }
.footer-logo { width: 54px; height: 54px; object-fit: contain; background: #fff; border-radius: 12px; padding: 0.25rem; }
.footer-title { margin: 0; font-weight: 850; color: #fff; }
.footer-note { margin: 0.2rem 0 0; font-size: 0.95rem; }
.footer-links a { color: #fff; }

.alignwide { max-width: min(100%, 1040px); }
.alignfull { width: 100vw; max-width: 100vw; margin-left: calc(50% - 50vw); }
.wp-caption { max-width: 100%; }
.wp-caption-text, .gallery-caption { font-size: 0.9rem; color: #6a6464; }
.sticky .entry-title::before { content: "Kiinnitetty: "; color: #6b6100; }
.bypostauthor { outline: 2px solid var(--hs-gold); }

@media (max-width: 860px) {
  .content-layout { grid-template-columns: minmax(0, 1fr); }
  .header-inner { grid-template-columns: 110px minmax(0, 1fr); align-items: center; }
  .site-logo-link { width: 110px; border-radius: 22px; }
  .footer-inner { grid-template-columns: 1fr; }
}

@media (max-width: 600px) {
  body { font-size: 16px; }
  .hero { min-height: 310px; background-size: auto 160px; }
  .header-inner { grid-template-columns: 1fr; padding-top: 1.6rem; }
  .site-logo-link { width: 96px; }
  .primary-menu { display: block; }
  .primary-menu a { padding: 0.85rem 0.25rem; }
  .primary-menu .sub-menu { position: static; display: block; box-shadow: none; border: 0; padding-left: 1rem; }
}

/* WordPress custom logo compatibility */
.custom-logo-link {
  display: block;
  width: 145px;
  aspect-ratio: 1;
  padding: 0.5rem;
  background: rgba(255,255,255,0.96);
  border: 4px solid var(--hs-gold);
  border-radius: 28px;
  box-shadow: 0 16px 34px rgba(0, 0, 0, 0.38);
}

.custom-logo-link img,
.custom-logo {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: contain;
  border-radius: 18px;
}

.footer-menu {
  display: flex;
  flex-wrap: wrap;
  gap: 0.9rem;
  margin: 0;
  padding: 0;
  list-style: none;
}

.search-form {
  display: flex;
  flex-wrap: wrap;
  gap: 0.6rem;
  align-items: center;
}

.search-form label { flex: 1 1 220px; }

@media (max-width: 860px) {
  .custom-logo-link { width: 110px; border-radius: 22px; }
}

@media (max-width: 600px) {
  .custom-logo-link { width: 96px; }
}
