@font-face {
    font-family: 'Andika';
    src: url('./fonts/Andika-Regular.ttf') format('truetype');
    font-weight: normal;
    font-style: normal;
}

@font-face {
    font-family: 'Andika';
    src: url('./fonts/Andika-Bold.ttf') format('truetype');
    font-weight: bold;
    font-style: normal;
}

@font-face {
    font-family: 'Andika';
    src: url('./fonts/Andika-Italic.ttf') format('truetype');
    font-weight: normal;
    font-style: italic;
}

@font-face {
    font-family: 'Andika';
    src: url('./fonts/Andika-BoldItalic.ttf') format('truetype');
    font-weight: bold;
    font-style: italic;
}

/* Apply the font site-wide */
body {
    font-family: 'Andika', sans-serif;
    background-color: var(--molla-bg-dark);
    color: white;
}

body.page {
    margin: 0;
}
:root {
    --molla-bg-light: #f4e4ca;
    --molla-bg-medium: #4a79a5;
    --molla-bg-dark: #01426A;
    --molla-red: #7B1805;
    --molla-max-width: 980px;
}

main {
    color: white;
}

.bg-light {    background-color: var(--molla-bg-light); color: #333; }
.bg-medium {   background-color: var(--molla-bg-medium); color: white; }
.bg-dark {     background-color: var(--molla-bg-dark); color: white; }

#page #primary .wp-block-group {
    padding: 0rem 0;
}

body.home #page #primary .wp-block-group {
    padding: 1.5rem 0;
}

.main-navigation {
    padding: 9px 0;
}

.main-navigation li {
    padding: 1rem;
    text-transform: uppercase;
    font-size: 13px;
}

.main-navigation li a {
    color: #fff;
}

.main-navigation ul ul.sub-menu {
    background-color: var(--molla-bg-dark);
    margin-top: -5px; /* Reduces gap */
    padding-top: 5px; /* Keeps submenu open when moving the mouse */
}

.main-navigation ul li:hover {
    background-color: #1C567B;
}

.main-navigation ul li:hover > ul,
.main-navigation ul li.focus > ul {
    left: -0.1rem;
}

.site-branding {
    position: relative;
    z-index: 8;
    padding: 0.1rem 0;
    background-color: #f4e4ca;
}

footer#colophon .site-info,
.is-layout-constrained,
.respect-site-max-width,
body.archive .posts-navigation .nav-links,
body.single .post-navigation .nav-links,
body.page:not(.home) article.page > .entry-content {
    max-width: var(--molla-max-width);
    margin: 0 auto;
}

.site-branding .respect-site-max-width {
    display: flex;
    align-items: center;
    gap: 20px;
    margin-top: -16px;
}

.site-branding .respect-site-max-width img.molla-script {
    max-width: 320px;
}

.site-branding .respect-site-max-width .name-and-description p {
    margin: 10px 0;
    line-height: 1.2;
    color: black;
}

.site-branding .respect-site-max-width .site-title a {
    text-decoration: none;
    color: black;
    font-size: 26px;
    transform: scaleY(1.3);
    display: block;
}

.site-branding .respect-site-max-width img.banner-mags {
    max-width: 272px;
    position: relative;
    top: 30px;
}

#primary {
    min-height: calc( 80vh - 200px );
}

#primary .post, #primary .page, #primary .cartoons {
    margin: 0;
    padding: 0;
}

#primary > article.page > header.entry-header {
    background-color: var(--molla-bg-medium);
}

body.home #primary > article.page > header.entry-header {
    display: none;
}

body.home #primary .is-layout-flex.grid-and-cloud {
    gap: 4rem;
}

.is-layout-flex.equiwidth > * {
    flex: 1;
}

#primary .cartoon-tag-cloud {
    text-align: justify;
}

#primary .cartoon-tag-cloud a:link {
    text-decoration: none;
    font-style: normal;
    color: white;
    padding-right: 0.5em;
    text-transform: lowercase;
    line-height: 32px;
    display: inline-block;
}

#primary .cartoon-tag-cloud a:visited {
    color: white;
}

#primary .cartoon-tag-cloud a.size-24:link,
#primary .cartoon-tag-cloud a.size-28:link,
#primary .cartoon-tag-cloud a.size-32:link,
#primary .cartoon-tag-cloud a.size-36:link,
#primary .cartoon-tag-cloud a.size-24:visited,
#primary .cartoon-tag-cloud a.size-28:visited,
#primary .cartoon-tag-cloud a.size-32:visited,
#primary .cartoon-tag-cloud a.size-36:visited {
    color: #EAC0A6;
}

#primary .molla-2x2grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: 2.5rem;
}

#primary .molla-2x2grid .featured-page {
  position: relative;
  aspect-ratio: 1 / 1;
  overflow: hidden;
}

#primary .molla-2x2grid .featured-page:nth-child(3n+1)::before {
  content: '';
  position: absolute;
  inset: 0;
  background: rgba(255, 255, 255, 0.6);
  z-index: 1;
  pointer-events: none;
}


#primary .molla-2x2grid .featured-image {
  display: block;
  height: 100%;
  width: 100%;
}

#primary .molla-2x2grid .featured-image img {
  object-fit: cover;
  height: 100%;
  width: 100%;
  display: block;
}

#primary .molla-2x2grid .featured-title {
    position: absolute;
    left: 0;
    top: 50%;
    transform: translateY(-50%);
    width: 100%;
    padding: 2.0rem 1rem;
    background: rgba(255,255,255, 0.6);
    color: black;
    font-size: 1.1rem;
    z-index: 1;
    margin: 0;
    text-align: center;
    box-sizing: border-box;
    font-weight: normal;
    font-size: 16px;
    z-index: 1;
}

#primary .molla-2x2grid .featured-page:nth-child(3n+1) .featured-title {
    background: transparent;
}

#primary .molla-2x2grid .featured-title a {
    color: inherit;
    text-decoration: none;
    font-style: normal;
}

#primary > article.page > header.entry-header h1 {
    font-weight: normal;
    color: white;
    font-size: 25px;
    padding: 0.3em 0;
}

body.page:not(.home) #primary > article.page {
    color: #333;
    background-color: var(--molla-bg-light);
    background-image: url(/wp-content/themes/molla/images/Molla-bottom-page.png);
    background-repeat: no-repeat;
    background-position: calc( 50% + 400px ) 100%;
    padding-bottom: 180px;
}

body.page article.page .post-thumbnail {
    display: none;
}

.wp-block-group .wp-block-group {
    padding-top: 0;
}

.wp-block-group .wp-block-group p:first-child {
    margin-top: -7px;
}

#primary > article.page > footer.entry-footer {
    background-color: transparent;
}

#primary > article.page > footer.entry-footer > .edit-link {
    max-width: var(--molla-max-width);
    margin: 0 auto;
    display: block;
}

body.single .post-navigation {
    margin: 0;
}

body.single .post-navigation .nav-links {
    padding: 1rem 0;
}

body.single #primary .post-navigation .nav-links > div {
    background-repeat: no-repeat;
    height: 40px;
    position: relative;
}

body.single #primary .post-navigation .nav-links .nav-previous {
    background-image: url(/wp-content/themes/molla/images/slider-red-arrow-l.png);
    background-position: left;
    padding-left: 40px;
}

body.single #primary .post-navigation .nav-links .nav-next {
    background-image: url(/wp-content/themes/molla/images/slider-red-arrow-r.png);
    background-position: right;
    padding-right: 40px;
}

body.single #primary .post-navigation .nav-links a {
    color: black;
    text-decoration: none;
    font-style: normal;
    position: relative;
    top: 8px;
}

body.single figure.cartoon-image img {
    display: block;
}

#primary > article.cartoons .cartoon-content-wrapper {
    padding: 1em 0;
}

#primary > article.cartoons .cartoon-content {
    display: flex;
    align-items: flex-start;
    gap: 45px;
}

.wp-block-group-is-layout-flex {
    gap: 45px;
}

#primary > article.cartoons .cartoon-content > figure,
#primary > article.page figure {
    margin: 0; /* Reset margins */
    flex-basis: 465px;
    flex-shrink: 0;
    border: var(--molla-bg-dark) solid 20px;
}

#primary > article.cartoons .cartoon-content > figure > img {
    display: block;
}

#primary > article.cartoons .cartoon-content > figure.alignleft,
#primary > article.page figure.alignleft {
    margin: .5em 1em .5em 0;
}

#primary > article.cartoons .cartoon-content > figure.alignright,
#primary > article.page figure.alignright {
    margin: .5em 0 .5em 1em;
}

#primary > article.cartoons .cartoon-content-wrapper p.subject {
    display: flex;
    flex-wrap: wrap;
    gap: 2em;
}

#primary > article.cartoons > header.entry-header {
    background-color: var(--molla-bg-medium);
}

body.home #primary > article.cartoons > header.entry-header {
    display: none;
}

#primary > article.cartoons > header.entry-header h1 {
    font-weight: normal;
    color: white;
    font-size: 25px;
    padding: 0.3em 0;
}

#primary > article.cartoons > footer.entry-footer {
    background-color: var(--molla-bg-light);
}

#primary > article.cartoons > footer.entry-footer > .edit-link {
    max-width: var(--molla-max-width);
    margin: 0 auto;
    display: block;
}


.molla-browse {
    padding: 1.5em 0;
}

footer#colophon {
    background-color: white;
    margin: 0;
    padding: 1.5rem;
    border-top: var(--molla-red) solid 10px;
    color: black;
}

#primary h2 {
    color: var(--molla-red);
    border-bottom: var(--molla-red) solid 2px;
    text-transform: uppercase;
    font-weight: normal;
    /* letter-spacing: -1px; */
    transform: scaleY(1.3);
    font-size: 16px;
    padding-bottom: 5px;
    margin: 1em 0;
}

#primary h3 {
    color: var(--molla-red);
    font-weight: normal;
    font-variant: small-caps;
    transform: scaleY(1.3);
    font-size: 16px;
    margin: 1em 0 1em;
}

#primary p {
    font-size: 16px;
}

#primary a {
    color: var(--molla-bg-medium);
    font-style: italic;
    font-size: 106%;
}

#primary ul {
    margin: 0;
}

#primary ul li {
    list-style-type: none;
}

#primary ul li:before {
    content: "-";
    display: inline-block;
    padding: 0 1rem;
}


body.archive #primary > header.page-header {
    background-color: var(--molla-bg-medium);
}

body.archive #primary > header.page-header h1 {
    font-weight: normal;
    color: white;
    font-size: 25px;
    padding: 0.3em 0;
}

.image-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 50px;
    margin-top: 50px;
    margin-bottom: 50px;
}

.image-grid .image-container {
  position: relative; /* Needed for absolute positioning of header */
  width: 100%; /* Make it responsive */
  padding-bottom: 100%; /* Create a square aspect ratio */
  overflow: hidden; /* Hide overflowing image parts */
}

.image-grid .image-container a.post-thumbnail img {
  position: absolute; /* Position image inside container */
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  object-fit: cover; /* Crop and fill the container */
  z-index: 20;
}

.image-grid .image-container header {
  position: absolute; /* Position header inside container */
  bottom: 0;
  left: 0;
  width: 100%;
  background: rgba(255, 255, 255, 0.5); /* Semi-transparent background */
  color: white;
  padding: 10px;
  box-sizing: border-box; /* Include padding in width */
  z-index: 50;
}

#primary .image-grid .image-container header h2 {
    border: none;
    color: black;
    font-size: 16px;
    text-transform: none;
    font-weight: normal;
    transform: none;
    padding-bottom: 2px;
    margin: 0;
    line-height: 1.2;
    text-align: center;
}

#primary .image-grid .image-container header h2 a {
    text-decoration: none;
    color: black;
    font-style: normal;
}

#primary .image-grid .image-container:hover header h2,
#primary .image-grid .image-container:hover header h2 a,
.molla-2x2grid article:hover h3 a {
    color: var(--molla-bg-medium);
}

.molla-2x2grid article:hover h3 {
    cursor: pointer;
}
