/*
Theme Name: Fantasy News
Theme URI: https://example.com
Author: Twoje Imię
Author URI: https://example.com
Description: Motyw fantasy blog z pergaminowym designem
Version: 1.0
License: GNU General Public License v2 or later
License URI: http://www.gnu.org/licenses/gpl-2.0.html
Text Domain: fantasy-news
*/
/*
PRINT FIX
*/
@media print {
  .no-print {
    display: none !important;
  }
  .print-fix {
    box-shadow: none !important;
    margin-top: -3.6rem;
  }
}

/* ========== Variables (mobile-first) ========== */
:root{
  --bg:#f6f3ea;
  --panel:#fffaf0;
  --accent:#b93b3b;
  --muted:#6b6b6b;
  --text:#222;
  --card-shadow: 0 6px 18px rgba(33,33,33,0.3);
  --radius:14px;
}
a[href="#"] {
  cursor: default !important;
}
.box-shadow {
  box-shadow: 1px 2px 3px black;
}

/* ========== Base ========== */
*{box-sizing:border-box}
html,body{height:100%;}
body{
  margin:0;
  font-family: "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  background: linear-gradient(180deg, #0f2027 0%, #203a43 50%, #2c5364 100%);
  color:var(--text);
  -webkit-font-smoothing:antialiased;
  -moz-osx-font-smoothing:grayscale;
  padding-bottom:48px;
  overflow-x: hidden;
}

a{color:inherit; text-decoration:none}
img{display:block; max-width:100%; height:auto; border-radius:8px;}

/* ========== Canvas / Paper frame ========== */
.wrap{
  max-width:1100px;
  margin:8px auto 36px auto;
  padding:20px;
  position:relative;
}

.leaves-left {
  position: absolute;
  top: -60px;
  left: -49px;
  z-index: 2;
  pointer-events: none;
  width: 300px;
  height: auto;
}
.leaves-right {
  position: absolute;
  top: -60px;
  right: -49px;
  z-index: 2;
  pointer-events: none;
  width: 300px;
  height: auto;
}
.leaves-left-2 {
  position: absolute;
  top: 94px;
  left: -45px;
  z-index: 2;
  pointer-events: none;
  width: 44px;
  height: auto;
}

.paper{
  background:var(--panel);
  border-radius:18px;
  padding:18px;
  box-shadow: 0 12px 40px rgba(5,10,15,0.45);
  position:relative;
  border: 1px solid rgba(0,0,0,0.06);
  
  /* Faktura pergaminu */
  background-image: 
    url('data:image/svg+xml;utf8,<svg viewBox="0 0 200 200" xmlns="http://www.w3.org/2000/svg"><filter id="noiseFilter"><feTurbulence type="fractalNoise" baseFrequency="0.9" numOctaves="4" stitchTiles="stitch"/></filter><rect width="100%" height="100%" filter="url(%23noiseFilter)" opacity="0.03"/></svg>'),
    radial-gradient(ellipse at top left, rgba(255,250,235,0.9), transparent 60%),
    radial-gradient(ellipse at bottom right, rgba(246,243,234,0.7), transparent 50%),
    linear-gradient(135deg, #fffbf3 0%, #fff9ed 50%, #faf6ea 100%);
  background-size: 200px 200px, 100% 100%, 100% 100%, 100% 100%;
  background-blend-mode: multiply, overlay, soft-light, normal;
  
  box-shadow: 
    inset 0 1px 3px rgba(139,117,87,0.08),
    inset 0 -1px 2px rgba(139,117,87,0.05),
    0 12px 40px rgba(5,10,15,0.45);
}

/* Decorative rough top bar */
.topbar{
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:12px;
  padding:8px 12px;
  margin-bottom:10px;
}

.logo{
  font-weight: 700;
  font-style: normal;
  display:flex;
  align-items:center;
  gap:10px;
  font-size:26px;
  color:#0f2430;
  letter-spacing:0.6px;
  vertical-align: middle;
}
.logo img {
  display: block;
  float: left; 
  width: 128px; height:128px;
  margin: -36px 0 -28px -36px;
}
.logo span {
  display: block;
  margin-top: -8px;
}
.logo a {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 8px;
}

nav li {
  list-style-type: none;
  padding: 2px;
  margin: 0;
}

/* ========== MENU - Mobile First ========== */
.nav-container {
  margin-left: auto;
  position: relative;
}

.menu-toggle {
  cursor: pointer;
  padding: 10px 12px;
  border: none;
  border-radius: 10px;
  background: linear-gradient(180deg, #fff, #fbf5ee);
  box-shadow: var(--card-shadow);
  display: flex;
  align-items: center;
  gap: 8px;
  font-weight: 600;
  font-size: 14px;
  color: #2b2b2b;
  font-family: inherit;
  user-select: none;
  transition: background 0.2s;
}

.menu-toggle:hover {
  background: linear-gradient(180deg, #fffaf0, #f9f0e8);
}

/* Menu domyślnie ukryte na mobile */
.main-menu {
  display: none;
  position: absolute;
  top: calc(100% + 8px);
  right: 0;
  min-width: 220px;
  margin: 0;
  padding: 12px;
  background: linear-gradient(180deg, #ffffff, #fbf5ee);
  border-radius: 12px;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.2);
  z-index: 1000;
  border: 1px solid rgba(0, 0, 0, 0.06);
}

/* Menu widoczne gdy ma klasę open */
.main-menu.open {
  display: block;
}

.main-menu ul,
.main-menu .menu-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.main-menu li {
  margin: 0;
  padding: 0;
  position: relative;
}

.main-menu a {
  display: block;
  padding: 10px 14px;
  border-radius: 8px;
  font-weight: 600;
  color: #2b2b2b;
  transition: background 0.2s;
  white-space: nowrap;
}

.main-menu a:hover {
  background: linear-gradient(90deg, #fff6f6, #fff);
}

/* Wskaźnik submenu - strzałka */
.main-menu li.menu-item-has-children > a::after {
  content: ' ▾';
  font-size: 11px;
  margin-left: 4px;
  opacity: 0.6;
}

/* ========== SUBMENU - Mobile ========== */
.main-menu .sub-menu {
  padding-left: 16px;
  margin-top: 0px;
  gap: 4px;
}

.main-menu .sub-menu a {
  font-size: 13px;
  font-weight: 500;
  padding: 8px 12px;
  opacity: 0.9;
}

.main-menu .sub-menu a:hover {
  opacity: 1;
}

/* ========== Hero ========== */
.hero{
  border-radius:12px;
  margin:6px 2px 18px 2px;
  position:relative;
}
.hero .hero-image{
  display:block;
  width:100%;
  height:200px;
  object-fit:cover;
}
.hero .hero-overlay{
  position:absolute;
  left:18px;
  bottom:18px;
  right:18px;
  display:flex;
  flex-direction:column;
  gap:8px;
  pointer-events: none;
  background: rgba(0,0,0,0.7);
  margin: -18px;
  padding: 18px;
}
.hero h1{
  margin:0;
  color:#fff;
  font-size:20px;
  text-shadow:0 6px 18px rgba(0,0,0,0.6);
  line-height: 1.3;
}
.hero h1 a{
  pointer-events: auto;
  transition: opacity 0.2s;
}
.hero h1 a:hover{
  opacity: 0.85;
}
.hero .meta{
  color:#f6e6d9;
  font-size:13px;
}
.hero .cta{
  display:inline-block;
  padding:8px 12px;
  background:rgba(255,255,255,0.1);
  border-radius:8px;
  color:#fff;
  font-weight:700;
  width:max-content;
  backdrop-filter: blur(2px);
  pointer-events: auto;
  transition: background 0.2s;
}
.hero .cta:hover{
  background:rgba(255,255,255,0.2);
}

/* Hero with sidebar layout */
.hero-container{
  display: grid;
  grid-template-columns: 1fr;
  gap: 18px;
  margin: 6px 2px 18px 2px;
}

.about-sidebar{
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  background: #fff;
  border-radius: 12px;
  padding: 16px;
  box-shadow: var(--card-shadow);
}
.about-sidebar h3{
  margin: 0 0 12px 0;
  font-size: 18px;
  color: #132428;
}
.about-sidebar p{
  margin: 0;
  font-size: 14px;
  line-height: 1.6;
  color: var(--muted);
}

/* ========== Sections ========== */
.section{
  margin:14px 0;
  padding:6px 6px 2px 6px;
}
.section h1 {
  font-size: 36px;
}
.section h2{
  font-size:24px;
  margin:6px 0;
  display:flex;
  align-items:center;
  gap:8px;
  color:#132428;
}
.section p.lead{
  margin:6px;
  color:var(--muted);
  font-size:13px;
}
.section img {
  margin: 16px auto;
}

/* Category description */
.category-description{
  margin: 16px 6px;
  padding: 16px;
  background: rgba(255,255,255,0.5);
  border-radius: 10px;
  border-left: 4px solid var(--accent);
}
.category-description h3{
  margin: 0 0 10px 0;
  color: #132428;
}
.category-description p{
  margin: 0;
  line-height: 1.6;
}

/* Cards row (one column on mobile) */
.cards{
  display:grid;
  gap:12px;
  grid-template-columns: 1fr;
  padding:6px;
}

.card{
  background:#fff;
  border-radius:12px;
  padding:10px;
  box-shadow:var(--card-shadow);
  display:flex;
  gap:10px;
  align-items:flex-start;
  transition: transform 0.2s, box-shadow 0.2s;
  cursor: pointer;
}
.card:hover{
  transform: translateY(-2px);
  box-shadow: 0 8px 24px rgba(33,33,33,0.18);
}

.card .thumb{flex:0 0 120px; width:120px; height:80px; overflow:hidden; border-radius:10px;}
.card .thumb img{width:100%; height:100%; object-fit:cover;}
.card .card-body{flex:1}
.card h3{margin:0 0 6px 0; font-size:15px}
.card p{margin:0; font-size:13px; color:var(--muted)}
.card .excerpt{
  margin-top: 6px;
  font-size: 13px;
  line-height: 1.4;
  color: var(--muted);
}

/* Small badges/buttons */
.btn{
  display:inline-block;
  padding:6px 10px;
  border-radius:8px;
  font-weight:700;
  font-size:13px;
  text-align:center;
}
.btn.primary{background:var(--accent); color:#fff;}
.btn.ghost{background:transparent; border:1px solid rgba(0,0,0,0.06); color:var(--text)}

/* ========== Grid for thumbnails lower section ========== */
.grid{
  display:grid;
  gap:10px;
  grid-template-columns: 1fr;
  margin-top:10px;
}
.grid-item{
  background:#fff;
  border-radius:10px;
  padding:8px;
  box-shadow:var(--card-shadow);
  display:flex;
  gap:8px;
  align-items:center;
  transition: transform 0.2s, box-shadow 0.2s;
  cursor: pointer;
}
.grid-item:hover{
  transform: translateY(-2px);
  box-shadow: 0 8px 24px rgba(33,33,33,0.18);
}
.grid-item img{width:92px; height:64px; object-fit:cover; border-radius:7px}
.grid-item h4{margin:0; font-size:14px}
.grid-item p{margin:4px 0 0 0; font-size:12px; color:var(--muted)}

/* ========== Footer ========== */
footer{
  margin-top:16px;
  padding:12px;
  text-align:center;
  color:var(--muted);
  font-size:13px;
}

/* ========== Decorative leaf svg wrappers ========== */
.leaf{
  position:absolute;
  width:140px;
  height:140px;
  pointer-events:none;
  opacity:0.95;
  filter: drop-shadow(0 6px 12px rgba(0,0,0,0.35));
}
.leaf.top-left{left:-20px; top:-20px; transform:rotate(-10deg) scale(1);}
.leaf.top-right{right:-20px; top:-18px; transform:rotate(20deg) scale(1);}
.leaf.bottom-left{left:-10px; bottom:-22px; transform:rotate(10deg) scale(1);}
.leaf.bottom-right{right:-6px; bottom:-12px; transform:rotate(-20deg) scale(1);}

/* ========== Single post content ========== */
.post-content{
  background: #fff;
  border-radius: 12px;
  padding: 24px;
  margin: 18px 6px;
  box-shadow: var(--card-shadow);
  line-height: 1.8;
}
.post-content a {
  text-decoration: underline;
  opacity: 0.9;
}
.post-content h1, .post-content h2, .post-content h3{
  color: #132428;
  margin-top: 1.5em;
  margin-bottom: 0.5em;
}
.post-content h1.single {
    margin-top: 0;
}
.post-content h1{font-size: 28px;}
.post-content h2{font-size: 24px;}
.post-content h3{font-size: 20px;}
.post-content p{
  margin: 1em 0;
}
.post-content img{
  margin: 1.5em auto;
}

.post-content h1:first-child, .post-content h2:first-child, .post-content h3:first-child {
  margin-top: 0;
}

.post-meta{
  color: var(--muted);
  font-size: 13px;
  border-bottom: 1px solid rgba(0,0,0,0.06);
  margin-bottom: 20px;
}

/* ========== Desktop (700px+) ========== */
@media(min-width: 700px) {
  /* Ukryj przycisk hamburger */
  .menu-toggle {
    display: none;
  }
  
  /* Menu zawsze widoczne na desktop */
  .main-menu {
    display: block !important;
    position: static;
    background: linear-gradient(180deg, rgba(255,255,255,0.8), rgba(251,245,238,0.8));
    padding: 8px 12px;
    border-radius: 10px;
    box-shadow: var(--card-shadow);
    min-width: auto;
  }
  
  .main-menu ul,
  .main-menu .menu-list {
    flex-direction: row;
    gap: 0;
  }
  
  .main-menu a {
    padding: 8px 16px;
    font-size: 14px;
  }
  
  /* ========== SUBMENU - Desktop (dropdown) ========== */
  
  /* Strzałka skierowana w prawo dla desktop */
  .main-menu li.menu-item-has-children > a::after {
    content: ' ▾';
    transition: transform 0.2s;
  }
  
  /* Ukryj submenu domyślnie */
  .main-menu .sub-menu {
    display: none;
    position: absolute;
    top: 100%;
    left: 0;
    min-width: 200px;
    padding: 8px;
    margin: 0;
    margin-top: 0px;
    background: linear-gradient(180deg, #ffffff, #fbf5ee);
    border-radius: 10px;
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.15);
    border: 1px solid rgba(0, 0, 0, 0.06);
    z-index: 1001;
    gap: 4px;
  }
  
  /* Pokaż submenu przy hover na rodzicu */
  .main-menu li.menu-item-has-children:hover > .sub-menu {
    display: flex;
    flex-direction: column;
    animation: fadeInDown 0.2s ease-out;
  }
  
  @keyframes fadeInDown {
    from {
      opacity: 0;
      transform: translateY(-8px);
    }
    to {
      opacity: 1;
      transform: translateY(0);
    }
  }
  
  /* Rotacja strzałki przy hover */
  .main-menu li.menu-item-has-children:hover > a::after {
    transform: rotate(-180deg);
  }
  
  .main-menu .sub-menu a {
    padding: 8px 12px;
    font-size: 13px;
    font-weight: 500;
  }
  
  .main-menu .sub-menu a:hover {
    background: linear-gradient(90deg, #fff6f6, #fff);
  }
  
  /* Jeśli submenu ma własne submenu (3 poziom) */
  .main-menu .sub-menu .sub-menu {
    top: 0;
    left: 100%;
    margin-left: 4px;
    margin-top: 0;
  }
  
  .main-menu .sub-menu li.menu-item-has-children > a::after {
    content: ' ▸';
  }
  
  /* Responsive layout */
  .hero-container {
    grid-template-columns: 2fr 1fr;
  }
  
  .hero .hero-image {
    height: 340px;
  }
  .cards {
    grid-template-columns: repeat(3, 1fr);
  }
  .card {
    flex-direction: column;
    align-items: stretch;
  }
  .card .thumb {
    width: 100%;
    height: 160px;
    flex: 0 0 auto;
  }
  .card .card-body {
    padding-top: 6px;
  }
  .grid {
    grid-template-columns: repeat(4, 1fr);
  }
  .logo {
    font-size: 22px;
  }
  .topbar {
    padding: 10px 14px;
  }
  .wrap {
    padding: 40px 8px;
  }
}

@media(min-width: 980px) {
  .wrap {
    max-width: 1200px;
  }
  .paper {
    padding: 26px;
  }
  .hero .hero-image {
    height: 420px;
  }
  .leaf {
    width: 200px;
    height: 200px;
    opacity: 1;
  }
}

/* Small utility */
.muted{color:var(--muted); font-size:13px}
.row{display:flex; gap:12px; align-items:center;}

/* Pagination */
.pagination{
  display: flex;
  justify-content: center;
  gap: 8px;
  margin: 24px 0;
}
.pagination a, .pagination span{
  padding: 8px 12px;
  background: #fff;
  border-radius: 8px;
  box-shadow: var(--card-shadow);
  font-weight: 600;
  font-size: 14px;
}
.pagination .current{
  background: var(--accent);
  color: #fff;
}

/* fixes for super small screens */
@media screen and (max-width: 420px) {
  .leaves-left, .leaves-right, .leaves-left-2 {
    display: none;
  }
  .logo img {
    display: none;
  }
}

blockquote {
  margin: 0 16px;
  padding: 16px;
  border-left: 1px solid black;
  background: rgba(0,0,0,0.1);
}