/*
Theme Name: Tšiili Seiklus
Theme URI: https://example.com
Author: Pere
Author URI: https://example.com
Description: Reisipäeviku-teemaline WordPress teema, loodud vahetusõpilase aasta jaoks Tšiilis. Postkaardi-stiilis postitused, Andide mäeahelik ja Valparaíso värvid.
Version: 1.0
Requires at least: 6.0
Requires PHP: 7.4
License: GNU General Public License v2 or later
License URI: LICENSE
Text Domain: tsiili-seiklus
*/

/* ==========================================================================
   TOKENS
   Palett:
   --andes-night   #1B3A4B  (Andide öötaevas - päis, nupud)
   --atacama       #C1502E  (Atacama kõrb - lingid, aktsent)
   --valparaiso    #F2B705  (Valparaíso majad - esiletõstud, templid)
   --pacific-cream #F7F2E7  (Vaikne ookean, taust)
   --desert-sand   #D9A66C  (kõrbeliiv - piirjooned)
   --ink           #2B2B28  (tekst)
   Fondid: Fraunces (pealkirjad), Inter (tekst), IBM Plex Mono (kuupäevad/templid)
   ========================================================================== */

@import url('https://fonts.googleapis.com/css2?family=Fraunces:ital,opsz,wght@0,9..144,400;0,9..144,600;0,9..144,700;1,9..144,500&family=Inter:wght@400;500;600&family=IBM+Plex+Mono:wght@500&display=swap');

:root {
  --andes-night: #1B3A4B;
  --atacama: #C1502E;
  --valparaiso: #F2B705;
  --pacific-cream: #F7F2E7;
  --desert-sand: #D9A66C;
  --ink: #2B2B28;
  --radius: 6px;
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  margin: 0;
  background: var(--pacific-cream);
  color: var(--ink);
  font-family: 'Inter', sans-serif;
  font-size: 17px;
  line-height: 1.65;
}

h1, h2, h3, h4 {
  font-family: 'Fraunces', serif;
  font-weight: 700;
  line-height: 1.15;
  margin: 0 0 .5em;
  color: var(--andes-night);
}

a { color: var(--atacama); text-decoration: none; }
a:hover { text-decoration: underline; }

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

.container { max-width: 1080px; margin: 0 auto; padding: 0 24px; }

/* ==========================================================================
   PÄIS
   ========================================================================== */

.site-header {
  background: var(--andes-night);
  color: #fff;
  padding: 28px 0 0;
}

.site-header .container {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 16px;
  padding-bottom: 24px;
}

.site-branding {
  display: flex;
  align-items: center;
  gap: 16px;
}

.custom-logo {
  height: 58px;
  width: auto;
  max-width: 58px;
  object-fit: contain;
  flex-shrink: 0;
}

.site-stamp {
  width: 58px; height: 58px;
  border: 2px dashed rgba(255,255,255,.55);
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-family: 'IBM Plex Mono', monospace;
  font-size: 10px;
  letter-spacing: .04em;
  text-align: center;
  color: var(--valparaiso);
  flex-shrink: 0;
  transform: rotate(-8deg);
}

.site-title {
  font-size: 1.9rem;
  margin: 0;
  color: #fff;
}
.site-title a { color: #fff; }
.site-title a:hover { text-decoration: none; opacity: .85; }

.site-description {
  margin: 2px 0 0;
  font-family: 'IBM Plex Mono', monospace;
  font-size: .78rem;
  letter-spacing: .06em;
  text-transform: uppercase;
  color: var(--valparaiso);
}

.main-navigation {
  display: flex;
  align-items: center;
  gap: 20px;
  flex-wrap: wrap;
}

.main-navigation ul {
  list-style: none;
  display: flex;
  gap: 22px;
  margin: 0; padding: 0;
  flex-wrap: wrap;
}

.main-navigation a {
  color: #fff;
  font-size: .95rem;
  font-weight: 500;
  padding-bottom: 2px;
  border-bottom: 2px solid transparent;
}
.main-navigation a:hover,
.main-navigation .current-menu-item > a {
  color: var(--valparaiso);
  border-bottom-color: var(--valparaiso);
  text-decoration: none;
}

.archive-dropdown select {
  background: transparent;
  color: #fff;
  border: 1px solid rgba(255,255,255,.4);
  border-radius: 6px;
  padding: 5px 10px;
  font-size: .9rem;
  font-family: inherit;
  cursor: pointer;
}
.archive-dropdown select:hover {
  border-color: var(--valparaiso);
}
.archive-dropdown select option {
  color: var(--ink);
}

/* Andide mäeahelik - dekoratiivne horisondijoon päise all */
.andes-skyline {
  display: block;
  width: 100%;
  height: 46px;
}

/* ==========================================================================
   POSTITUSTE RUUDUSTIK (avaleht) - "postkaardid"
   ========================================================================== */

.content-wrap {
  padding: 48px 0 64px;
}

.postcard-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 20px;
}

.postcard {
  background: #fff;
  border-radius: var(--radius);
  box-shadow: 0 2px 4px rgba(27,58,75,.08), 0 8px 20px rgba(27,58,75,.06);
  overflow: hidden;
  position: relative;
  transition: transform .2s ease, box-shadow .2s ease;
}
.postcard:nth-child(odd)  { transform: rotate(-.6deg); }
.postcard:nth-child(even) { transform: rotate(.5deg); }
.postcard:hover {
  transform: rotate(0deg) translateY(-4px);
  box-shadow: 0 10px 26px rgba(27,58,75,.16);
}

/* Pilt + selle peale kaetud pealkiri, nagu postkaardi tagakülje pealdis */
.postcard-thumb {
  position: relative;
  display: block;
  aspect-ratio: 4 / 5;
  overflow: hidden;
  background: var(--desert-sand);
}
.postcard-thumb img {
  width: 100%; height: 100%;
  object-fit: cover;
  transition: transform .35s ease;
}
.postcard:hover .postcard-thumb img { transform: scale(1.06); }

.postcard-title-overlay {
  position: absolute;
  left: 0; right: 0; bottom: 0;
  padding: 34px 14px 12px;
  background: linear-gradient(
    to top,
    rgba(27,58,75,.95) 0%,
    rgba(27,58,75,.72) 40%,
    rgba(27,58,75,0) 100%
  );
}
.postcard-title-overlay .postcard-eyebrow {
  display: block;
  font-family: 'IBM Plex Mono', monospace;
  font-size: .62rem;
  letter-spacing: .08em;
  text-transform: uppercase;
  color: var(--valparaiso);
  margin-bottom: 3px;
}
.postcard-title-overlay h2 {
  margin: 0;
  font-size: 1.05rem;
  line-height: 1.25;
  color: #fff;
}
.postcard-title-overlay h2 a { color: #fff; }
.postcard-title-overlay h2 a:hover { color: var(--valparaiso); text-decoration: none; }

.postmark {
  position: absolute;
  top: 10px; right: 10px;
  background: rgba(247,242,231,.94);
  border: 1.5px dashed var(--atacama);
  border-radius: 50%;
  width: 50px; height: 50px;
  display: flex; align-items: center; justify-content: center;
  text-align: center;
  font-family: 'IBM Plex Mono', monospace;
  font-size: 8px;
  line-height: 1.2;
  color: var(--atacama);
  transform: rotate(6deg);
  z-index: 2;
}

.postcard h2 { font-size: 1.3rem; margin-bottom: .35em; }
.postcard h2 a { color: var(--andes-night); }
.postcard h2 a:hover { color: var(--atacama); text-decoration: none; }

.postcard-excerpt {
  font-size: .95rem;
  color: #4a4a44;
}

.read-more {
  display: inline-block;
  margin-top: 12px;
  font-family: 'IBM Plex Mono', monospace;
  font-size: .8rem;
  letter-spacing: .03em;
  text-transform: uppercase;
  color: var(--atacama);
}

/* ==========================================================================
   ÜKSIKPOSTITUS
   ========================================================================== */

.single-post-header { max-width: 760px; margin: 0 auto 28px; }
.single-post-header .postmark { position: static; transform: rotate(-4deg); margin-bottom: 14px; }

.single-post-header h1 { font-size: 2.4rem; }

.post-meta {
  font-family: 'IBM Plex Mono', monospace;
  font-size: .8rem;
  color: var(--andes-night);
  opacity: .75;
  text-transform: uppercase;
  letter-spacing: .04em;
}

.single-featured-image {
  max-width: 900px;
  margin: 0 auto 32px;
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: 0 10px 30px rgba(27,58,75,.14);
}

.entry-content {
  max-width: 720px;
  margin: 0 auto;
  font-size: 1.08rem;
}
.entry-content p { margin: 0 0 1.3em; }
.entry-content h2, .entry-content h3 { margin-top: 1.4em; }
.entry-content blockquote {
  border-left: 3px solid var(--valparaiso);
  margin: 1.6em 0;
  padding: .2em 0 .2em 1.2em;
  font-style: italic;
  color: #4a4a44;
}

/* Gutenbergi pildid ja galeriid - fotode jaoks */
.entry-content img,
.entry-content .wp-block-image {
  border-radius: var(--radius);
}
.entry-content figure { margin: 1.8em 0; }
.entry-content figcaption {
  font-family: 'IBM Plex Mono', monospace;
  font-size: .78rem;
  color: #6b6b62;
  text-align: center;
  margin-top: 6px;
}

.wp-block-gallery {
  margin: 2em 0;
}
.wp-block-gallery .wp-block-image img {
  border-radius: var(--radius);
  box-shadow: 0 4px 14px rgba(27,58,75,.14);
  transition: transform .2s ease;
}
.wp-block-gallery .wp-block-image:nth-child(odd) img { transform: rotate(-1.2deg); }
.wp-block-gallery .wp-block-image:nth-child(even) img { transform: rotate(1deg); }
.wp-block-gallery .wp-block-image img:hover { transform: rotate(0) scale(1.02); }

/* ==========================================================================
   KOMMENTAARID (pere jaoks)
   ========================================================================== */

.comments-area { max-width: 720px; margin: 56px auto 0; }
.comments-title { font-size: 1.4rem; }
.comment-list { list-style: none; margin: 0; padding: 0; }
.comment-body {
  background: #fff;
  border: 1px dashed var(--desert-sand);
  border-radius: var(--radius);
  padding: 16px 18px;
  margin-bottom: 16px;
}
.comment-author { font-weight: 600; color: var(--andes-night); font-size: .92rem; }
.comment-metadata { font-family: 'IBM Plex Mono', monospace; font-size: .72rem; color: #8a8a80; }

.comment-form input[type="text"],
.comment-form input[type="email"],
.comment-form textarea {
  width: 100%;
  padding: 10px 12px;
  border: 1.5px solid var(--desert-sand);
  border-radius: var(--radius);
  font-family: 'Inter', sans-serif;
  margin-bottom: 12px;
}
.comment-form button,
.wp-block-button__link,
button, input[type="submit"] {
  background: var(--atacama);
  color: #fff;
  border: none;
  padding: 10px 22px;
  border-radius: 999px;
  font-family: 'Inter', sans-serif;
  font-weight: 600;
  cursor: pointer;
}
.comment-form button:hover, input[type="submit"]:hover { background: #a83f1e; }

/* ==========================================================================
   KÜLGRIBA
   ========================================================================== */

.sidebar { margin-top: 56px; }
.widget {
  background: #fff;
  border-radius: var(--radius);
  padding: 20px 22px;
  margin-bottom: 22px;
  box-shadow: 0 2px 10px rgba(27,58,75,.08);
}
.widget-title {
  font-size: 1.05rem;
  text-transform: uppercase;
  letter-spacing: .04em;
  color: var(--valparaiso);
  background: var(--andes-night);
  display: inline-block;
  padding: 3px 10px;
  border-radius: 4px;
  margin-bottom: 12px;
}

/* ==========================================================================
   JALUS
   ========================================================================== */

.site-footer {
  background: var(--andes-night);
  color: rgba(255,255,255,.75);
  margin-top: 60px;
  padding: 30px 0;
  text-align: center;
  font-family: 'IBM Plex Mono', monospace;
  font-size: .8rem;
  letter-spacing: .03em;
}
.site-footer a { color: var(--valparaiso); }

/* ==========================================================================
   RESPONSIIVSUS
   ========================================================================== */

@media (max-width: 640px) {
  .site-header .container { flex-direction: column; align-items: flex-start; }
  .single-post-header h1 { font-size: 1.8rem; }
  .postcard:nth-child(odd), .postcard:nth-child(even) { transform: none; }
  .postcard:hover { transform: translateY(-3px); }
}

@media (prefers-reduced-motion: reduce) {
  * { transition: none !important; scroll-behavior: auto !important; }
}
