/*
Theme Name: Howly Grid Magazin
Theme URI: https://example.local/howly-grid-magazin
Author: Howly & ChatGPT
Description: Fixed-Sidebar Magazin-Theme mit Customizer-gesteuerter Startseite für „Deine letzten Beiträge“.
Version: 1.0.28
Requires at least: 6.2
Tested up to: 6.6
Requires PHP: 7.4
License: GPLv2 or later
Text Domain: howly-grid
*/

:root{
  --hg-sidebar-width: 350px;
  --hg-sidebar-bg-color: #050505;
  --hg-sidebar-bg-image: none;
  --hg-sidebar-bg-position: center center;
  --hg-sidebar-bg-size: cover;
  --hg-sidebar-bg-repeat: no-repeat;
  --hg-sidebar-overlay: transparent;
  --hg-sidebar-text: #fff;
  --hg-main-bg: #ededed;
  --hg-card-bg: #050505;
  --hg-card-text: #fff;
  --hg-gap: clamp(14px, 1.4vw, 24px);
  --hg-radius: 0px;
  --hg-icon-size: 18px;
  --hg-slider-height: 350px;
  --hg-masonry-columns: 4;
  --hg-mobile-burger-color: #ffffff;
}
*{box-sizing:border-box}
html{scroll-behavior:smooth}
body{margin:0;background:var(--hg-main-bg);color:#111;font-family:system-ui,-apple-system,BlinkMacSystemFont,"Segoe UI",sans-serif;font-size:16px;line-height:1.55}
a{color:inherit;text-decoration:none}
img{max-width:100%;height:auto;display:block}
.screen-reader-text{position:absolute;left:-9999px}

.hg-layout{min-height:100vh;background:var(--hg-main-bg)}
.hg-sidebar{position:fixed;inset:0 auto 0 0;width:var(--hg-sidebar-width);height:100vh;overflow-y:auto;background-color:var(--hg-sidebar-bg-color);background-image:var(--hg-sidebar-bg-image);background-position:var(--hg-sidebar-bg-position);background-size:var(--hg-sidebar-bg-size);background-repeat:var(--hg-sidebar-bg-repeat);color:var(--hg-sidebar-text);padding:42px 34px;z-index:20;box-shadow:8px 0 24px rgba(0,0,0,.12)}
.hg-sidebar::before{content:"";position:absolute;inset:0;background:var(--hg-sidebar-overlay);pointer-events:none;z-index:0}
.hg-sidebar-inner{position:relative;z-index:1;display:flex;min-height:100%;flex-direction:column;gap:26px}

.hg-mobile-bar{display:none;position:fixed;top:0;left:0;right:0;height:86px;z-index:1200;background:var(--hg-sidebar-bg-color);background-image:var(--hg-sidebar-bg-image);background-position:var(--hg-sidebar-bg-position);background-size:var(--hg-sidebar-bg-size);background-repeat:var(--hg-sidebar-bg-repeat);color:var(--hg-sidebar-text);align-items:center;justify-content:space-between;padding:12px 18px;box-sizing:border-box;box-shadow:0 8px 28px rgba(0,0,0,.18)}
.hg-mobile-bar::before{content:"";position:absolute;inset:0;background:var(--hg-sidebar-overlay);pointer-events:none}
.hg-mobile-brand,.hg-mobile-toggle{position:relative;z-index:1}
.hg-mobile-brand{display:flex;align-items:center;gap:12px;color:inherit;text-decoration:none;min-width:0}
.hg-mobile-brand .hg-logo-img{max-width:none;margin:0}
.hg-mobile-brand .hg-logo-img img,.hg-mobile-brand .custom-logo{max-height:48px;width:auto;display:block}
.hg-mobile-brand .hg-site-title{font-size:22px;font-weight:800;line-height:1;letter-spacing:-.04em}
.hg-mobile-brand .hg-subtitle{font-size:13px;line-height:1.15;opacity:.9;margin-top:3px}
.hg-mobile-toggle{appearance:none;border:0;background:transparent;color:var(--hg-mobile-burger-color,#fff);width:52px;height:52px;display:grid;place-items:center;padding:0;cursor:pointer}
.hg-mobile-toggle .dashicons{font-size:34px;width:34px;height:34px;line-height:34px}
.hg-mobile-toggle:focus-visible{outline:2px solid currentColor;outline-offset:3px}
.hg-brand{display:block;text-align:center}
.hg-logo-img{max-width:180px;margin:0 auto 6px}
.hg-site-title{font-size:clamp(28px,3vw,44px);font-weight:500;line-height:1.05;letter-spacing:-.04em}
.hg-subtitle{margin-top:4px;font-size:15px;opacity:.85}

.hg-social{display:flex;flex-wrap:wrap;gap:10px;justify-content:center}
.hg-social a{width:42px;height:42px;display:grid;place-items:center;background:rgba(255,255,255,.18);border:1px solid rgba(255,255,255,.12);transition:.2s ease}
.hg-social a:hover{background:rgba(255,255,255,.32);transform:translateY(-2px)}
.hg-social .dashicons{font-size:22px;width:22px;height:22px}

.hg-main-menu ul{list-style:none;margin:0;padding:0}
.hg-main-menu li{border-bottom:1px dashed rgba(255,255,255,.4)}
.hg-main-menu a{display:flex;align-items:center;gap:10px;padding:9px 0;font-size:15px;transition:.18s ease}
.hg-main-menu a:hover{opacity:.72;padding-left:4px}
.hg-main-menu .hg-menu-icon{font-size:var(--hg-icon-size);width:var(--hg-icon-size);height:var(--hg-icon-size);line-height:var(--hg-icon-size);flex:0 0 var(--hg-icon-size)}
.hg-main-menu .hg-menu-custom-icon{object-fit:contain;display:block}
.hg-icons-only .menu-item-title{position:absolute;left:-9999px}
.hg-icons-only a{justify-content:center;padding:12px 0}
.hg-main-menu.hg-icons-caption a{display:flex;flex-direction:column;align-items:center;justify-content:center;gap:7px;text-align:center;padding:14px 0}
.hg-main-menu.hg-icons-caption .menu-item-title{display:block;position:static;left:auto;text-transform:uppercase;font-size:clamp(10px,calc(var(--hg-icon-size) * .22),22px);line-height:1.08;letter-spacing:.075em;font-weight:800;max-width:100%;overflow-wrap:anywhere}
.hg-main-menu.hg-icons-caption .hg-menu-icon{margin:0 auto;flex:0 0 var(--hg-icon-size)}
.hg-no-menu-icons .hg-menu-icon{display:none}

.hg-sidebar-widgets{margin-top:auto;display:grid;gap:16px}
.hg-widget-box{background:rgba(255,255,255,.16);padding:18px;color:var(--hg-sidebar-text)}
.hg-widget-box :where(h1,h2,h3,h4,p){margin-top:0}

.hg-main{margin-left:var(--hg-sidebar-width);padding:clamp(26px,4vw,52px);min-height:100vh}
.hg-main-inner{max-width:1380px;margin:0 auto;display:grid;gap:var(--hg-gap)}

.hg-top-area{display:grid;grid-template-columns:minmax(0,2fr) minmax(220px,.9fr);gap:var(--hg-gap);align-items:stretch}
.hg-top-area.no-top-widget{grid-template-columns:minmax(0,1fr);min-height:var(--hg-slider-height,350px)}
.hg-top-area.no-top-widget > .hg-slider{display:block;grid-column:1 / -1;width:100%;max-width:none}
.hg-top-area.no-top-widget > .hg-top-widget{display:none!important}
.hg-top-area.is-hidden{display:none}
.hg-slider{--hg-slide-duration:6.8s;position:relative;height:var(--hg-slider-height,350px);overflow:hidden;background:#292929;color:#fff;isolation:isolate;container-type:inline-size}
.hg-slider::before{content:"";position:absolute;inset:0 auto 0 0;width:40%;background:#2d2d2d;z-index:3;pointer-events:none}
.hg-slider::after{content:"";position:absolute;top:0;bottom:0;left:40%;width:20%;background:linear-gradient(90deg,rgba(45,45,45,1) 0%,rgba(45,45,45,.70) 42%,rgba(45,45,45,0) 100%);z-index:4;pointer-events:none}
.hg-slider a{color:inherit;text-decoration:none}
.hg-slider-track{position:absolute;inset:0;display:flex;width:100%;height:100%;will-change:transform}
.hg-slider[data-count="1"] .hg-slider-track{transform:translateX(0)}
.hg-slider[data-count="2"] .hg-slider-track{animation:hgTrack2 calc(var(--hg-slide-duration) * 2 + 1.5s) infinite both}
.hg-slider[data-count="3"] .hg-slider-track{animation:hgTrack3 calc(var(--hg-slide-duration) * 3 + 2.2s) infinite both}
.hg-image-track{z-index:1}
.hg-text-track{z-index:5;pointer-events:none}
.hg-image-slide,.hg-text-slide{position:relative;flex:0 0 100%;height:100%;min-width:100%}
.hg-image-slide{display:block;background:#777;overflow:hidden;pointer-events:auto}
.hg-image-slide img{width:100%;height:100%;object-fit:cover;filter:saturate(.94);display:block}
.hg-slide-kicker{position:absolute;top:58px;left:70px;z-index:6;width:min(330px,34%);font-size:clamp(14px,1.05vw,20px);line-height:1.28;font-weight:400;opacity:.96;pointer-events:auto}
.hg-slide-title{position:absolute;left:-.035em;bottom:-.07em;z-index:6;width:min(72%,880px);font-size:clamp(36px,3.55vw,62px);line-height:.92;font-weight:900;text-transform:uppercase;letter-spacing:-.05em;margin:0;pointer-events:auto;text-wrap:balance}
@supports (font-size: 1cqw){.hg-slide-title{font-size:clamp(36px,6.35cqw,62px)}}
@keyframes hgTrack2{
  0%,40%{transform:translateX(0)}
  50%,90%{transform:translateX(-100%)}
  100%{transform:translateX(-200%)}
}
@keyframes hgTrack3{
  0%,25%{transform:translateX(0)}
  33%,58%{transform:translateX(-100%)}
  66%,91%{transform:translateX(-200%)}
  100%{transform:translateX(-300%)}
}
.hg-corner{position:absolute;z-index:7;pointer-events:none}
.hg-corner::before,.hg-corner::after{content:"";position:absolute;background:#fff}
.hg-corner-tl{top:24px;left:24px;width:135px;height:105px}
.hg-corner-tl::before{width:100%;height:9px;left:0;top:0}
.hg-corner-tl::after{width:9px;height:100%;left:0;top:0}
.hg-corner-br{top:24px;right:24px;bottom:24px;width:150px;height:auto;background:
  linear-gradient(#fff,#fff) right top/100% 9px no-repeat,
  linear-gradient(#fff,#fff) right bottom/100% 9px no-repeat,
  linear-gradient(#fff,#fff) right top/9px 100% no-repeat}
.hg-corner-br::before,.hg-corner-br::after{display:none}
.hg-top-widget{background:#b8b8b8;display:grid;place-items:center;min-height:230px;padding:22px;color:#fff;font-size:clamp(28px,3vw,52px);font-weight:800;letter-spacing:-.08em;overflow:hidden}
.hg-top-widget .widget{font-size:16px;font-weight:400;letter-spacing:0;color:#111;width:100%}

.hg-section{display:block}.hg-section.is-hidden{display:none}
.hg-link-blocks{display:grid;gap:3px;grid-template-columns:repeat(var(--hg-link-count,4),minmax(0,1fr))}
.hg-link-card{position:relative;background:var(--hg-card-bg);color:var(--hg-link-text-color,#fff);min-height:126px;padding:0;display:flex;align-items:var(--hg-link-align-items,center);font-size:var(--hg-link-font-size,26px);line-height:1.15;border:1px solid rgba(255,255,255,.18);transition:.22s ease;overflow:hidden;text-decoration:none}
.hg-link-card::before{content:"";position:absolute;inset:0;background:var(--hg-link-bg-image) center/cover no-repeat;opacity:0;transition:transform .35s ease,opacity .2s ease;transform:scale(1)}
.hg-link-card::after{content:"";position:absolute;inset:0;background:linear-gradient(90deg,rgba(0,0,0,.50),rgba(0,0,0,.18));opacity:0;transition:.2s ease}
.hg-link-card.has-bg-image::before,.hg-link-card.has-bg-image::after{opacity:1}
.hg-link-card > span{position:relative;z-index:1;display:block;width:100%;box-sizing:border-box;padding:.48em .7em;background:var(--hg-link-text-bg,rgba(0,0,0,.55));color:var(--hg-link-text-color,#fff);text-align:var(--hg-link-text-align,left);text-transform:var(--hg-link-text-transform,normal);font-weight:650;letter-spacing:-.03em}
.hg-link-card:hover::before{transform:scale(1.075)}
.hg-link-card:hover{filter:brightness(1.06)}

.hg-feature-strip{position:relative;background:#050505;color:#fff;min-height:92px;display:flex;align-items:center;padding:28px;overflow:hidden}
.hg-feature-strip.has-image::before{content:"";position:absolute;inset:0;background:var(--hg-feature-bg) center/cover no-repeat;opacity:.34;filter:saturate(.9)}
.hg-feature-strip > *{position:relative;z-index:1}
.hg-feature-strip h2,.hg-feature-strip p{margin:0}.hg-feature-strip h2{font-size:clamp(24px,3vw,44px);font-weight:600}.hg-feature-strip p{font-size:18px;opacity:.86}

.hg-masonry-wrap{background:transparent;color:#111;padding:0}
.hg-masonry-title{text-align:left;font-size:clamp(24px,2.6vw,38px);font-weight:650;margin:0 0 18px;letter-spacing:-.035em}
.hg-masonry{display:grid;grid-template-columns:repeat(var(--hg-masonry-columns,4),minmax(0,1fr));grid-auto-rows:8px;gap:var(--hg-gap);width:100%;align-items:start}
.hg-post-tile{background:#fff;color:#111;display:block;box-shadow:0 10px 24px rgba(0,0,0,.12);transition:transform .2s ease,box-shadow .2s ease;overflow:hidden;break-inside:avoid}
.hg-post-tile:hover{transform:translateY(-3px);box-shadow:0 16px 34px rgba(0,0,0,.16)}
.hg-post-tile img{width:100%;height:auto;display:block;aspect-ratio:4/3;object-fit:cover;background:#ccc}
.hg-post-tile:nth-child(4n+2) img{aspect-ratio:16/10}
.hg-post-tile:nth-child(4n+3) img{aspect-ratio:1/1}
.hg-post-tile:nth-child(4n+4) img{aspect-ratio:5/3}
.hg-post-tile-content{padding:18px;display:flex;flex-direction:column;gap:8px}.hg-post-tile-date{font-size:12px;text-transform:uppercase;letter-spacing:.08em;opacity:.55}.hg-post-tile-title{font-size:22px;line-height:1.12;margin:0}.hg-post-tile-excerpt{font-size:14px;color:#444;margin:0;line-height:1.45}
.hg-placeholder{background:repeating-linear-gradient(135deg,#222,#222 12px,#2e2e2e 12px,#2e2e2e 24px);aspect-ratio:4/3;color:#fff;display:grid;place-items:center;text-align:center;padding:24px}
.hg-post-tile:nth-child(4n+3) .hg-placeholder{aspect-ratio:1/1}

@media (max-width:1024px){
  :root{--hg-sidebar-width:280px;--hg-masonry-columns:2}.hg-sidebar{padding:30px 24px}.hg-main{padding:28px}.hg-top-area{grid-template-columns:1fr}.hg-link-blocks{grid-template-columns:repeat(2,minmax(0,1fr))}.hg-slider{height:min(var(--hg-slider-height,350px),320px)}.hg-slider::before{width:58%}.hg-slider::after{left:58%;width:24%}.hg-slide-kicker{left:48px;top:54px;width:48%;font-size:14px}.hg-slide-title{width:90%;font-size:clamp(34px,8cqw,54px)}.hg-corner-tl{top:18px;left:18px;width:86px;height:72px}.hg-corner-br{top:18px;right:18px;bottom:18px;width:94px}
}
@media (max-width:760px){
  :root{--hg-sidebar-width:100%;--hg-masonry-columns:1}
  body{padding-top:112px}
  .hg-mobile-bar{
    display:flex;
    height:112px;
    align-items:center;
    justify-content:space-between;
    padding:14px 18px;
  }
  .hg-mobile-brand{
    flex-direction:column;
    align-items:flex-start;
    justify-content:center;
    gap:7px;
    text-align:left;
    max-width:calc(100% - 74px);
  }
  .hg-mobile-brand .hg-logo-img,.hg-mobile-brand .custom-logo-link{
    display:block;
    margin:0;
  }
  .hg-mobile-brand .hg-logo-img img,.hg-mobile-brand .custom-logo{
    max-height:62px;
    max-width:min(260px,calc(100vw - 120px));
    width:auto;
  }
  .hg-mobile-brand .hg-site-title{font-size:24px;line-height:1}
  .hg-mobile-brand .hg-subtitle{
    display:block;
    margin:0;
    font-size:14px;
    line-height:1.1;
    text-align:left;
    white-space:normal;
  }
  .hg-mobile-toggle{flex:0 0 56px;width:56px;height:56px}
  .hg-mobile-toggle .dashicons{font-size:38px;width:38px;height:38px;line-height:38px}
  .hg-sidebar{position:fixed;top:112px;left:0;width:100%;height:calc(100vh - 112px);min-height:auto;z-index:900;transform:translateX(-105%);transition:transform .28s ease;box-shadow:14px 0 34px rgba(0,0,0,.25);overflow-y:auto;padding:26px 24px}
  body.hg-mobile-menu-open .hg-sidebar{transform:translateX(0)}
  body.hg-mobile-menu-open{overflow:hidden}
  body .hg-sidebar .hg-brand{display:none!important}
  .hg-main{margin-left:0;padding:18px}
  .hg-link-blocks{grid-template-columns:1fr}
  .hg-masonry{grid-template-columns:1fr}
  .hg-slide-title{font-size:40px;width:94%}
  .hg-corner-br{width:78px}
}


/* =========================
   Standard WordPress Content Templates
   ========================= */
.hg-content-wrap{background:#fff;color:#111;padding:clamp(24px,4vw,56px);box-shadow:0 14px 36px rgba(0,0,0,.08)}
.hg-content-header{margin:0 0 28px;border-bottom:1px solid rgba(0,0,0,.12);padding-bottom:22px}
.hg-content-title{font-size:clamp(34px,5vw,68px);line-height:.95;letter-spacing:-.055em;margin:0;font-weight:850}
.hg-content-meta{margin-top:12px;color:#666;font-size:14px}
.hg-content-body{font-size:18px;line-height:1.7;max-width:920px}
.hg-content-body :where(h1,h2,h3,h4,h5,h6){line-height:1.15;letter-spacing:-.03em;margin:1.6em 0 .55em}
.hg-content-body :where(p,ul,ol,blockquote,figure){margin-top:0;margin-bottom:1.1em}
.hg-content-body a{text-decoration:underline;text-underline-offset:3px}
.hg-content-body img{height:auto;max-width:100%}
.hg-content-body .alignwide{max-width:1180px;width:calc(100vw - var(--hg-sidebar-width) - 120px)}
.hg-content-body .alignfull{max-width:none;width:calc(100vw - var(--hg-sidebar-width));margin-left:calc((920px - (100vw - var(--hg-sidebar-width))) / 2)}
.hg-entry-thumb{margin:0 0 28px;overflow:hidden;background:#ddd}.hg-entry-thumb img{width:100%;height:auto;max-height:560px;object-fit:cover}
.hg-list{display:grid;gap:var(--hg-gap)}
.hg-list-card{display:grid;grid-template-columns:minmax(180px,.36fr) minmax(0,1fr);background:#fff;color:#111;box-shadow:0 12px 30px rgba(0,0,0,.08);overflow:hidden}
.hg-list-card-thumb{background:#ddd;min-height:180px}.hg-list-card-thumb img{width:100%;height:100%;object-fit:cover}.hg-list-card-content{padding:24px}.hg-list-card-title{font-size:clamp(24px,2.4vw,40px);line-height:1.05;margin:0 0 10px;letter-spacing:-.045em}.hg-list-card-excerpt{color:#444;margin:0 0 18px}.hg-readmore{display:inline-flex;background:#050505;color:#fff;padding:10px 16px;text-decoration:none!important}.hg-pagination{display:flex;gap:10px;flex-wrap:wrap;margin-top:28px}.hg-pagination .page-numbers{background:#fff;color:#111;padding:9px 13px}.hg-pagination .current{background:#050505;color:#fff}.hg-empty{background:#fff;padding:32px}.hg-404-search{margin-top:24px}.hg-404-search input[type="search"]{width:min(100%,420px);padding:12px;border:1px solid #bbb}.hg-404-search input[type="submit"]{padding:12px 18px;background:#050505;color:#fff;border:0}
@media (max-width:760px){.hg-content-wrap{padding:24px 18px}.hg-list-card{grid-template-columns:1fr}.hg-content-body .alignwide,.hg-content-body .alignfull{width:auto;margin-left:0}}


/* =========================
   Plugin-/Shortcode-safe Page Layout
   Verhindert, dass Fullwidth-Shortcodes/Blocks unter die fixed Sidebar rutschen.
   Normale Textinhalte bleiben lesbar begrenzt, komplexe Plugin-UIs bekommen aber die volle Mainframe-Breite.
   ========================= */
body.page .hg-content-body{max-width:none;width:100%;min-width:0}
body.page .hg-content-body > :where(p,ul,ol,blockquote,h1,h2,h3,h4,h5,h6,figure){max-width:920px}
body.page .hg-content-body > :where(.alignwide,.alignfull){max-width:100%;width:100%;margin-left:0;margin-right:0}
.hg-content-body :where(.alignwide,.alignfull){max-width:100%;width:100%;margin-left:0;margin-right:0}
.hg-content-wrap{min-width:0}
.hg-main,.hg-main-inner,.hg-content-body{min-width:0}

/* v1.0.28 mobile sidebar corrections */
@media (max-width:760px){
  body{padding-top:120px}
  .hg-mobile-bar{
    display:flex!important;
    height:120px;
    align-items:center!important;
    justify-content:space-between!important;
    gap:16px;
    padding:16px 24px!important;
    background-color:var(--hg-sidebar-bg-color)!important;
    background-image:var(--hg-sidebar-bg-image)!important;
    background-position:var(--hg-sidebar-bg-position)!important;
    background-size:var(--hg-sidebar-bg-size)!important;
    background-repeat:var(--hg-sidebar-bg-repeat)!important;
  }
  .hg-mobile-bar::before{background:var(--hg-sidebar-overlay)!important}
  .hg-mobile-brand{
    display:flex!important;
    flex:1 1 auto;
    flex-direction:column!important;
    align-items:flex-start!important;
    justify-content:center!important;
    gap:5px!important;
    max-width:calc(100% - 78px)!important;
    min-width:0;
    margin:0!important;
    text-align:left!important;
  }
  .hg-mobile-brand .hg-logo-img{
    display:block!important;
    max-width:none!important;
    margin:0!important;
    padding:0!important;
    align-self:flex-start!important;
    text-align:left!important;
  }
  .hg-mobile-brand .custom-logo{
    display:block!important;
    max-height:64px!important;
    max-width:min(260px,calc(100vw - 128px))!important;
    width:auto!important;
    height:auto!important;
    margin:0!important;
  }
  .hg-mobile-brand .hg-subtitle{
    display:block!important;
    margin:0!important;
    padding:0!important;
    text-align:left!important;
    align-self:flex-start!important;
    line-height:1.15!important;
  }
  .hg-mobile-toggle{margin-left:auto!important;flex:0 0 56px!important}
  .hg-sidebar{
    top:120px!important;
    height:calc(100vh - 120px)!important;
    padding-top:28px!important;
  }
  .hg-sidebar > .hg-sidebar-inner > .hg-brand,
  .hg-sidebar .hg-brand{
    display:none!important;
    visibility:hidden!important;
    height:0!important;
    min-height:0!important;
    overflow:hidden!important;
    margin:0!important;
    padding:0!important;
  }
}
