/*
Theme Name: My-Theme
Author: Sang Ah Lee
Description: Custom WordPress theme built from scratch
Version: 1.0
Text Domain: my-theme
*/

/* -------------------- RESET -------------------- */

*,
*::before,
*::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

/* -------------------- BODY & LAYOUT -------------------- */

html {
  scroll-behavior: smooth;
}

body {
  color: #000;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  min-height: 100vh;
    font-family: Arial, serif;
  overflow-x: hidden;
}

.site-header,
.footer,
.content,
.desktop-menu {
  width: 100%;
  padding: 0 15px;
}

/* -------------------- TOP BAR -------------------- */
.top-bar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    width: 100%;
    margin: 0 auto;
    padding: 5px 0;
    font-size: 14px;
    color: #333;
    border-bottom: 1px solid #ddd;
    box-sizing: border-box;
}

.top-bar-left {
    text-align: left;
    font-family: Arial, serif;
}

.top-bar-center {
    text-align: center;
    font-weight: normal;
    font-family: Arial, serif;
}

.top-bar-right {
    text-align: right;
    font-family: Arial, serif;
}

.top-bar-right .header-button {
    display: inline-block;
    padding: 4px 8px;
    font-size: 13px;
    text-decoration: none;
    border: 1px solid #ccc;
    border-radius: 4px;
    color: #000;
}

.top-bar-right .header-button:hover {
    background-color: #f0f0f0;
}

/* -------------------- SITE TITLE + DATE STACK -------------------- */
.site-title-wrapper {
    display: flex;
    align-items: flex-start;       /* align top of children */
    justify-content: center;       /* center site title */
    position: relative;
    width: 100%;
    padding: 20px 0;               /* top and bottom space for wrapper */
    min-height: 80px;              /* ensure wrapper height includes all children */
    box-sizing: border-box;
}

.date-stack {
    position: absolute;
    left: 0;
    top: 20px;                     /* top space matches wrapper padding */
    line-height: 1.2;
    font-size: 14px;
    text-align: left;
}

.site-title {
    display: inline-block;
    text-align: center;
    margin: 0;
    padding-top: 20px;             /* add top space to align with date-stack */
}

.site-title-main {
    font-size: 32px;
    color: #000;
    font-weight: bold;
}

.site-title a,
.site-title a:hover,
.site-title a:focus,
.site-title a:active {
    text-decoration: none;
    color: inherit;
    cursor: pointer;
}

/* -------------------- ABOVE PAGE/POST TITLE -------------------- */
.kicker a {
    font-size: 13px;
    font-family: Arial, serif;
}

/* -------------------- SEPARATOR -------------------- */
.post-separator {
    border-top: 1px solid #a3a3a3;
    margin: 50px 0; 
    width: 100%;
}

/* -------------------- CONTENT -------------------- */

.content {
  flex: 1;
  text-align: left;
    margin: 0 auto;
}

.home .content img {
    width: 100%;       
    max-width: 100%;  
    height: auto;
    display: block;
    margin: 0 auto;
}

.content h2,
.content h3 {
    margin-top: 1.5em;
    margin-bottom: 0.7em;
}

.content p {
  margin: 20px 0;
  font-size: 16px;
  line-height: 1.8;
}


/* -------------------- PAGE WIDTH -------------------- */
.page .top-bar,
.page .content,
.page .site-header,
.page .site-title-wrapper,
.page .desktop-menu-wrapper,
.page .sub-menu-section,
.page .footer {
  max-width: 90%;
  margin: 0 auto;
  padding: 0;
  box-sizing: border-box;
}

.top-bar,
.content,
.site-header,
.site-title-wrapper,
.desktop-menu-wrapper,
.sub-menu-section,
.footer {
  max-width: 90%;
  margin: 0 auto;
  padding: 0;
  box-sizing: border-box;
}

/* -------------------- POST WIDTH -------------------- */
.single .top-bar,
.single .content,
.single .site-header,
.single .site-title-wrapper,
.single .desktop-menu-wrapper,
.single .sub-menu-section,
.single .footer {
  max-width: 90%;
  margin: 0 auto;
  padding: 0;
  box-sizing: border-box;
}

/* -------------------- PAGE ID ‼️ -------------------- */
.page-id-0 .page-wrapper,  /* ? */
.page-id-6 .page-wrapper,  /* 소개 */
.page-id-38 .page-wrapper,  /* 블로그 */
.page-id-19 .page-wrapper,  /* Home */
.single .page-wrapper { /* Single Post */
  display: flex;          
  gap: 5%;              
  max-width: 90%;       
  margin: 0 auto;     
  box-sizing: border-box;
}

/* Left content column (Content) */
.page-id-0 .page-wrapper .content, /* ? */
.page-id-6 .page-wrapper .content, /* 소개 */
.page-id-38 .page-wrapper .content, /* 블로그 */
.page-id-19 .page-wrapper .content, /* Home */
.single .page-wrapper .content { /* Single Post */
  flex: 0 0 60%;       
  margin: 0;          
  box-sizing: border-box;
}

/* Right column (ads, info) */
.page-id-0 .page-wrapper .right-column, /* ? */
.page-id-6 .page-wrapper .right-column, /* 소개 */
.page-id-38 .page-wrapper .right-column, /* 블로그 */
.page-id-19 .page-wrapper .right-column, /* Home */
.single .page-wrapper .right-column { /* Single Post */
  flex: 1;              
  margin: 0;
  box-sizing: border-box;
  position: sticky;
  top: 20px;      
  align-self: flex-start; 
}



/* -------------------- DESKTOP MENU -------------------- */
.desktop-menu-wrapper {
    position: relative;
}

.desktop-menu {
    width: 100%;
    font-family: Arial, serif;
    border-bottom: 3px double black;
}

.desktop-menu .menu {
    display: flex;
    justify-content: center;
    list-style: none;
    margin: 0;
    padding: 0;
}

.desktop-menu .menu > li {
    position: relative;
}

/* Main menu links */
.desktop-menu .menu > li > a {
    display: block;
    padding: 0 15px 15px 15px;
    color: #000;
    font-size: 13px;
    text-decoration: none;
    transition: all 0.2s ease;
}

.desktop-menu .menu > li > a:hover {
    text-decoration: underline;
}

/* -------------------- SUBMENU (HOVER) -------------------- */
.menu li.menu-item-has-children {
    position: relative;
}

.menu li.menu-item-has-children > ul.sub-menu {
    display: none;
    position: absolute;
    top: 100%;
    left: 0;
    background: #fff;
    padding: 20px;
    box-shadow: 0 2px 5px rgba(0,0,0,0.05);
    list-style: none;
    z-index: 200;
    white-space: nowrap;
    flex-wrap: wrap;
}

.menu li.menu-item-has-children:hover > ul.sub-menu {
    display: block;
    flex-direction: column;  
    gap: 5px;            
}

.menu li.menu-item-has-children ul.sub-menu li {
    position: relative;
}

/* Submenu links */
.menu li.menu-item-has-children ul.sub-menu li a {
    display: block;
    color: #000;
    text-decoration: none;
    padding: 3px 0;     
    font-size: 13px;    
    line-height: 1.3;   
}

.menu li.menu-item-has-children ul.sub-menu li a:hover {
    text-decoration: underline;
}

/* -------------------- NESTED SUBMENUS -------------------- */
.menu li.menu-item-has-children ul.sub-menu li.menu-item-has-children > ul.sub-menu {
    display: none;
    position: absolute;
    top: 0;
    left: 100%;
    background: #fff;
    padding: 15px;
    box-shadow: 0 2px 5px rgba(0,0,0,0.05);
    white-space: nowrap;
    flex-direction: column;
}

.menu li.menu-item-has-children ul.sub-menu li.menu-item-has-children:hover > ul.sub-menu {
    display: block;
}

/* -------------------- COLUMN CLASS FOR SPECIFIC SUBMENU -------------------- */
.menu-column > ul.sub-menu {
    display: flex;
    flex-direction: column;
    padding: 0;
    margin: 0;
}

.menu-column ul.sub-menu li {
    display: block;
    margin: 0;
}

/* Make child submenus inside menu-column appear normally */
.menu-column ul.sub-menu li.menu-item-has-children > ul.sub-menu {
    top: 0;
    left: 100%;
    display: none;
    position: absolute;
}

.menu-column ul.sub-menu li.menu-item-has-children:hover > ul.sub-menu {
    display: block;
}

/* -------------------- OPTIONAL STYLING -------------------- */
.header-button {
    padding: 5px 10px;
    margin-left: 10px;
    border: 1px solid #000;
    text-decoration: none;
    color: #000;
    font-size: 13px;
    transition: all 0.2s ease;
}

.header-button:hover {
    background: #000;
    color: #fff;
}

.menu-amb > a::first-letter {
    color: #3692e2;
}

.menu-bold > a {
    font-weight: bold;
}

/* Make the submenu a grid */
.columns .sub-menu {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 5px;
    padding: 0;
    margin: 0;
}

.columns .sub-menu li a {
    display: block;
    padding: 5px 10px;
}

/* -------------------- FOOTER -------------------- */
.footer {
    padding: 20px;
    font-family: Arial, serif;
    border-top: 3px double black;
}

.footer a {
    text-decoration: none;
}

.footer-sns {
    margin: 20px 0;
}

.footer-divider {
    height: 1px;
    margin: 20px 0;
}

.footer-links {
    display: flex;
    justify-content: flex-start;
    gap: 50px;
}

.footer-column {
    display: flex;
    flex-direction: column;
}

.footer-title {
    font-weight: bold;
    text-transform: uppercase;
    margin-bottom: 20px;
    font-size: 13px;
}

.footer-list {
    list-style: none;
    padding: 0;
    margin: 0;
}

.footer-list li {
    font-weight: normal;
    text-transform: none;
    margin-bottom: 6px;
    font-size: 13px;
}

.footer-bottom {
    text-align: center;
    margin: 10px 0;
    font-size: 13px;
    border-top: 1px solid black;
}

/* -------------------- RESPONSIVE -------------------- */

@media screen and (max-width: 768px) {

  .desktop-menu { display: none; }

  .mobile-header { display: flex; }

  .site-title {
    padding-top: 30px;
    padding-bottom: 60px;
  }

}

@media screen and (min-width: 769px) {

  .mobile-header,
  .mobile-menu {
    display: none;
  }

}

/* -------------------- POST HEADER -------------------- */

.post-title {
    margin-bottom: 0.5em;
}

.standfirst {
    margin-top: 0;
    margin-bottom: 1em;
    font-size: 1rem;
    font-weight: 400;
    color: #666;
    font-style: italic;
}

.post-meta {
    display: flex;
    flex-direction: column;
    gap: 0.2em;
    margin-top: 0;
}

.post-author {
    font-size: 0.85rem;
    font-weight: 600;
    color: #000;
}

.post-date {
    font-size: 0.85rem;
    font-weight: 500;
    color: #666;
    margin-bottom: 30px;
}

/* -------------------- FEEDSTACK (The Reader) -------------------- */

.feedstack {
    display: flex;
    flex-direction: column;
    padding: 0 10px;
    box-sizing: border-box;
}

/* LINK + TEXT RESET */
.feedstack a,
.feedstack a:hover,
.feedstack a:focus,
.feedstack a:active,
.feedstack-item,
.feedstack-item:hover,
.feedstack-item:focus,
.feedstack-item:active {
    text-decoration: none;
    color: inherit;
}

/* ITEM */
.feedstack-item {
    display: flex;
    justify-content: space-between;
    align-items: stretch;
    gap: 20px;

    height: 180px;
    overflow: hidden;
    background: transparent;

    padding: 20px 0;
    border-bottom: 1px solid #ddd;

    transition: none;
}

/* TEXT SIDE */
.feedstack-text {
    display: flex;
    flex-direction: column;
    flex: 1;
    min-width: 0;
    max-width: calc(100% - 240px - 20px);
}

/* EXACT TYPOGRAPHY FROM BOOKS */
.feedstack-section,
.feedstack-date {
    font-size: 13px;
    font-family: Arial, serif;
    color: #666;
    margin: 2px 0;
}

/* TITLE */
.feedstack-title {
    font-size: 22px;
    color: #3692e2;
    margin: 2px 0;

    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;

    transition: color 0.3s ease;
}

/* EXCERPT  */
.feedstack-excerpt {
    font-size: 16px;
    color: #666;
    margin: 2px 0;

    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

/* IMAGE*/
.feedstack-image {
    height: 100%;
    aspect-ratio: 4 / 3;
    flex-shrink: 0;
}

.feedstack-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;

    transition: none;
}

/* HOVER */
.feedstack-item:hover .feedstack-title {
    color: #89B8E0;
}

.feedstack-item:hover .feedstack-section,
.feedstack-item:hover .feedstack-date,
.feedstack-item:hover .feedstack-excerpt,
.feedstack-item:hover .feedstack-image img {
    opacity: 0.8;
}

/* -------------------- LINK -------------------- */
a {
    text-decoration: none;
    color: #3692e2;
}

a:hover {
    text-decoration: underline;
}

.secret-bird,
.secret-bird:hover,
.secret-bird:focus,
.secret-bird:active {
    color: inherit;
    text-decoration: none;
}

/* Remove rounding from feed items and images */
.feed-item,
.feed-item img {
    border-radius: 0;
}

/* -------------------- LISTS -------------------- */
.content ul,
.content ol {
  margin: 0 0 1em 0;      
  padding-left: 1.5em;  
}

.content ul ul,
.content ol ol {
  margin: 0 0 1em 0;
  padding-left: 2.5em;    
}

.content ul ul ul,
.content ol ol ol {
  margin: 0 0 1em 0;
  padding-left: 3.5em;    
}

ul,
ol {
  margin: 0 0 1em 0;      
  padding-left: 1.5em;  
}

ul ul,
ol ol {
  margin: 0 0 1em 0;
  padding-left: 2.5em;
}

ul ul ul,
ol ol ol {
  margin: 0 0 1em 0;
  padding-left: 3.5em;
}

.dash-list {
  list-style: none;
  padding-left: 1.5em;
  margin: 0;
}

.dash-list > li {
  position: relative;
  padding-left: 0;
}

.dash-list > li::before {
  content: "- ";
  position: absolute;
  left: -1em;
}

.dash-list ul {
  list-style: disc;
  padding-left: 1.5em;
  margin: 0;
}

.dash-list ul li::before {
  content: none;
}

/* -------------------- DROPDOWN -------------------- */
.dropdown {
    display: flex;
    justify-content: space-between;
    align-items: center;
    width: 100%;
    margin: 0 auto 20px;
    padding: 5px 0;
    font-family: Arial, serif;
    font-size: 16px;
    color: #333;
    box-sizing: border-box;
}

.dropdown select {
    font-size: 16px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.month-row td {
    text-align: center;
    font-weight: bold;
    background-color: #eee;
    padding: 10px 0;
    border-bottom: 1px solid rgba(0,0,0,0.1);
}

.year-row td {
    font-weight: bold;
    background: #4169E1;
    color: #fff;
    padding: 10px;
    text-align: center;
    text-transform: uppercase;
}

/* -------------------- PRIVATE FEED ROW -------------------- */

.private-content {
    width: 100%;
    max-width: none;
}

.private-content .feedstack-item {
    min-height: unset;
    height: auto;
    padding: 8px 0;
}

/* TEXT WRAPPER */
.private-content .feedstack-text {
    padding: 0;
    margin: 0;
    max-width: 100%;
}

/* ===== HEADER & ROW ===== */

.feed-header,
.feed-row {
    display: flex;
    align-items: center;
    width: 100%;
    gap: 8px; /* spacing between all columns */
}

/* HEADER */
.feed-header {
    font-size: 13px;
    font-weight: 600;
    padding: 6px 0;
    border-bottom: 2px solid #000;
}

/* ROW */
.feed-row {
    font-size: 16px;
    line-height: 1.2;
    padding: 4px 0;
    white-space: nowrap;
    overflow: hidden;
}

/* ===== COLUMNS ===== */

/* TITLE */
.col-title {
    flex: 1 1 auto; /* fills remaining space */
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* GROUP WRAPPER */
.col-group-wrap {
    display: flex;
    flex: 0 0 120px; /* narrow enough to pull columns left */
    width: 120px;
    box-sizing: border-box;
}

/* numbers */
.col-num {
    flex: 1;
    text-align: right;
    padding: 0 4px;
}

/* DATE */
.col-date {
    flex: 0 0 120px;
    width: 120px;
    margin-left: 0; /* remove auto push */
}

/* ===== HEADER ALIGNMENT ===== */

.feed-header .col-group-wrap {
    justify-content: center;
    text-align: center;
}

/* ===== COLUMN BACKGROUNDS ===== */

.group-total {
    background: rgba(0, 0, 0, 0.12); /* darkest */
}

.group-oh {
    background: rgba(0, 0, 0, 0.08); /* medium */
}

.group-sang {
    background: rgba(0, 0, 0, 0.04); /* lightest */
}

/* ===== HIDE UNUSED ===== */

.feedstack-excerpt,
.feedstack-date,
.feedstack-image {
    display: none;
}

/* ===== ROW STYLE ===== */

.feedstack-item {
    display: block;
    border-bottom: 1px solid #ddd;
    text-decoration: none;
    color: inherit;
}

.feedstack-item:hover {
    background: rgba(0,0,0,0.03);
}

/* Only affect row numbers, not headers */
.feed-row .col-group-wrap {
    flex: 0 0 auto;       /* remove fixed width, shrink to fit content */
    width: auto;          /* let it adjust to content size */
    justify-content: flex-start; /* keep numbers left inside group */
    gap: 8px;             /* spacing between numbers */
}

.feed-row .col-num {
    flex: 0 0 auto;       /* shrink to content */
    text-align: right;
    padding: 0 6px;       /* spacing between each number */
}

/* Reduce space between title and first group without affecting numbers */
.feed-row .col-title {
    margin-right: 4px; /* smaller space after title */
}

/* -------------------- PRIVATE ACF BOX -------------------- */
.acf-money-table {
  width: 100%;               /* stretch full width */
  border-collapse: collapse; /* clean borders */
  border: 1px solid #ccc;    /* box border */
  background: #f9f9f9;       /* light background */
  margin-top: 50px;
}

.acf-money-table th {
  font-weight: bold;
  background: #e0e0e0;       /* darker gray for headers */
  text-align: center;          /* first column left-aligned */
  padding: 10px;
  border: 1px solid #ccc;
}

.acf-money-table th:first-child {
  text-align: left;          /* ensure first column labels left */
}

.acf-money-table td {
  text-align: right;         /* values right-aligned */
  padding: 10px;
  border: 1px solid #ccc;
}
